Johny Posted December 31, 2011 at 05:17 PM Report #429449 Posted December 31, 2011 at 05:17 PM <?php //Estatisticas dos browsers if ((ereg("Nav", $_SERVER["HTTP_USER_AGENT"])) || (ereg("Gold", $_SERVER["HTTP_USER_AGENT"])) || (ereg("X11", $_SERVER["HTTP_USER_AGENT"])) || (ereg("Mozilla", $_SERVER["HTTP_USER_AGENT"])) || (ereg("Netscape", $_SERVER["HTTP_USER_AGENT"])) AND (!ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) AND (!ereg("Konqueror", $_SERVER["HTTP_USER_AGENT"])) AND (!ereg("Yahoo", $_SERVER["HTTP_USER_AGENT"])) AND (!ereg("Firefox", $_SERVER["HTTP_USER_AGENT"]))) $browser = "Netscape"; elseif(ereg("Firefox", $_SERVER["HTTP_USER_AGENT"])) $browser = "Firefox"; elseif(ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) $browser = "MSIE"; elseif(ereg("Lynx", $_SERVER["HTTP_USER_AGENT"])) $browser = "Lynx"; elseif(ereg("Opera", $_SERVER["HTTP_USER_AGENT"])) $browser = "Opera"; elseif(ereg("WebTV", $_SERVER["HTTP_USER_AGENT"])) $browser = "WebTV"; elseif(ereg("Konqueror", $_SERVER["HTTP_USER_AGENT"])) $browser = "Konqueror"; elseif((eregi("bot", $_SERVER["HTTP_USER_AGENT"])) || (ereg("Google", $_SERVER["HTTP_USER_AGENT"])) || (ereg("Slurp", $_SERVER["HTTP_USER_AGENT"])) || (ereg("Scooter", $_SERVER["HTTP_USER_AGENT"])) || (eregi("Spider", $_SERVER["HTTP_USER_AGENT"])) || (eregi("Infoseek", $_SERVER["HTTP_USER_AGENT"]))) $browser = "Bot"; else $browser = "Outro"; //Estatisticas dos Sistemas Operativos if(ereg("Win", $_SERVER["HTTP_USER_AGENT"])) $os = "Windows"; elseif((ereg("Mac", $_SERVER["HTTP_USER_AGENT"])) || (ereg("PPC", $_SERVER["HTTP_USER_AGENT"]))) $os = "Mac"; elseif(ereg("Linux", $_SERVER["HTTP_USER_AGENT"])) $os = "Linux"; elseif(ereg("FreeBSD", $_SERVER["HTTP_USER_AGENT"])) $os = "FreeBSD"; elseif(ereg("SunOS", $_SERVER["HTTP_USER_AGENT"])) $os = "SunOS"; elseif(ereg("IRIX", $_SERVER["HTTP_USER_AGENT"])) $os = "IRIX"; elseif(ereg("BeOS", $_SERVER["HTTP_USER_AGENT"])) $os = "BeOS"; elseif(ereg("OS/2", $_SERVER["HTTP_USER_AGENT"])) $os = "OS/2"; elseif(ereg("AIX", $_SERVER["HTTP_USER_AGENT"])) $os = "AIX"; else $os = "Outro"; Boas malta tenho este codigo que estava a funcionar correctamente, mas agora mudei de servidor e está me a dar este erro Deprecated: Function ereg() is deprecated in estatisticas.php on line 3 Deprecated: Function ereg() is deprecated in estatisticas.php on line 3 Deprecated: Function ereg() is deprecated in estatisticas.php on line 3 Deprecated: Function ereg() is deprecated in estatisticas.php on line 3 Deprecated: Function ereg() is deprecated in estatisticas.php on line 3 Deprecated: Function ereg() is deprecated in estatisticas.php on line 4 Deprecated: Function ereg() is deprecated in estatisticas.php on line 5 Deprecated: Function ereg() is deprecated in estatisticas.php on line 14 como posso corrigir isto? #############
yoda Posted December 31, 2011 at 05:42 PM Report #429450 Posted December 31, 2011 at 05:42 PM Usa o preg_match() em vez do ereg() http://www.php.net/manual/en/function.preg-match.php before you post, what have you tried? - http://filipematias.info sense, purpose, direction
Johny Posted December 31, 2011 at 06:10 PM Author Report #429456 Posted December 31, 2011 at 06:10 PM Agora aparece-se este erro: Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in estatisticas.php on line 3 Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in estatisticas.php on line 3 Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in estatisticas.php on line 3 Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in estatisticas.php on line 3 Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in estatisticas.php on line 3 Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash inestatisticas.php on line 14 #############
yoda Posted December 31, 2011 at 06:47 PM Report #429458 Posted December 31, 2011 at 06:47 PM Tem de ser adaptada a syntax a essa função. before you post, what have you tried? - http://filipematias.info sense, purpose, direction
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now