ciao a tutti
ho un problemino, mi è stata postata questa funzione, ma piu di qualche volta non mi restituisce nulla, c'è qualche errore o ci sono altri motivi possibili ?
grazie
$agent = getenv("HTTP_USER_AGENT");
function browser_in_use() {
global $agent;
$b =& $agent;
if (eregi("Opera[ \/]([0-9\.]+)",$b)) {
$type = "Opera";
} elseif (eregi("netscape[[:alnum:]]*[ \/]([0-9\.]+)",$b)) {
$type = "Netscape Navigator";
} elseif (eregi("msie[ \/]([0-9\.]+)",$b)) {
$type = "Internet Explorer";
} elseif (eregi("Mozilla[ \/]([0-9\.]+)" ,$b)) {
if (eregi("firefox",$b)) {
$type = "Mozilla Firefox";
} elseif (eregi("konqueror",$b)) {
$type = "Konqueror";
} elseif (eregi("galeon",$b)) {
$type = "Galeon";
} elseif (eregi("gecko",$b)) {
$type = "Mozilla";
} else {
$type = "NotRec";}
} elseif (eregi("([[:alnum:]]+)[ \/v]*([0-9\.]+)" ,$b)) {
$type = $a[1];
} else { $type = "NotRec";}
return $type;}
$browser=browser_in_use();
echo $browser;