Codice PHP:
$browser_search = array(
"MSIE 6.0",
"MSIE 5.5",
"MSIE 5.0",
"MSIE 4.0",
"Internet Explorer 6",
"Internet Explorer 5.5",
"Internet Explorer 5",
"Internet Explorer 4",
"Opera",
"Konqueror",
"Mozilla/5.0",
"Mozilla/5",
"Firefox/12.0",
"Mozilla/4",
"Mozilla",
"Netscape 6.x",
"Netscape 4.x",
"Netscape"
);
$os_search = array(
"Windows 2000",
"Windows 98",
"Windows 95",
"Windows 95",
"Windows 98",
"Win95",
"Win98",
"Windows NT",
"Windows NT 4.0",
"Windows NT 5.0",
"Windows NT 6.1",
"Windows XP",
"Windows XP",
"Windows ME",
"Windows NT 6.1",
"Mac_PowerPC",
"WinNT",
"Win7",
"Macintosh",
"Macintosh",
"SunOS",
"Linux",
"WinNT"
);
$ip = $_SERVER['REMOTE_ADDR'];
$DELOLDTIME = mktime (0, 0, 0, date("m"),date("d"),date("Y"));
$ReloadDelay = 300;
$time_limit = (time() - $ReloadDelay);
$u_page = @getenv("SCRIPT_NAME");
$HOSTMASK = gethostbyaddr($ip);
$u_referrer = @getenv("HTTP_REFERER");
$other = 1;
while(list($key, $value) = each ($browser_search)) {
$pos = strpos ($HTTP_USER_AGENT, $value);
if($pos !== false){
$IBROWSER = $browser[$key];
$other = 0;
break 1;
}
}
if($other != "0"){ $IBROWSER = "Unknown"; }
$other = 1;
while(list($key, $value) = each ($os_search)) {
$pos = strpos ($HTTP_USER_AGENT, $value);
if($pos !== false){
$OPSYS = $os[$key];
$other = 0;
break 1;
}
}
if($other != 0){ $OPSYS = "Unknown"; }
In parte funzionava discretamente.