PHP expert |
|
$http_u_a = strtolower(rawurldecode($_SERVER['HTTP_USER_AGENT']));
if(eregi('opera ([0-9]+\.[0-9]+)', $http_u_a, $regs)){
$browser = "Opera ".$regs[1];
}
elseif(eregi('msie ([0-9]+\.[0-9]+)', $http_u_a, $regs)){
$browser = "Microsoft Internet Explorer ".$regs[1];
}
elseif(eregi('lynx/([0-9]+\.[0-9]+\.[0-9]+)', $http_u_a, $regs)){
$browser = "Lynx ".$regs[1];
}
elseif((eregi('bot', $http_u_a)) || (eregi('google', $http_u_a)) || (eregi('slurp', $http_u_a)) || (eregi('scooter', $http_u_a)) || (eregi('spider', $http_u_a)) || (eregi('crawler', $http_u_a)) || (eregi('archiver', $http_u_a))){
$browser = 'Zoekmachine';
}
elseif(eregi('netscape6/([0-9]+\.[0-9]+\.[0-9]+)', $http_u_a, $regs)){
$browser = "Netscape ".$regs[1];
}
elseif (eregi('mozilla/(.?)firefox/([0-9]{0,2}\.[0-9]{0,2}\.[0-9]{0,2})', $http_u_a, $regs)){
$browser = "Mozilla Firefox ".$regs[1];
}
elseif (eregi('mozilla/([0-9]+\.[0-9]+)', $http_u_a, $regs)){
$browser = "Mozilla ".$regs[1];
}
else{
$browser = "Onbekend";
}
if(eregi('opera ([0-9]+\.[0-9]+)', $http_u_a, $regs)){ $browser = "Opera ".$regs[1]; } elseif(eregi('msie ([0-9]+\.[0-9]+)', $http_u_a, $regs)){ $browser = "Microsoft Internet Explorer ".$regs[1]; } elseif(eregi('lynx/([0-9]+\.[0-9]+\.[0-9]+)', $http_u_a, $regs)){ $browser = "Lynx ".$regs[1]; } elseif((eregi('bot', $http_u_a)) || (eregi('google', $http_u_a)) || (eregi('slurp', $http_u_a)) || (eregi('scooter', $http_u_a)) || (eregi('spider', $http_u_a)) || (eregi('crawler', $http_u_a)) || (eregi('archiver', $http_u_a))){ $browser = 'Zoekmachine'; } elseif(eregi('netscape6/([0-9]+\.[0-9]+\.[0-9]+)', $http_u_a, $regs)){ $browser = "Netscape ".$regs[1]; } elseif (eregi('mozilla/(.?)firefox/([0-9]{0,2}\.[0-9]{0,2}\.[0-9]{0,2})', $http_u_a, $regs)){ $browser = "Mozilla Firefox ".$regs[1]; } elseif (eregi('mozilla/([0-9]+\.[0-9]+)', $http_u_a, $regs)){ $browser = "Mozilla ".$regs[1]; } else{ $browser = "Onbekend"; }
Komt van Dit script. |