Caricamento...<?php
// Ritorna il browser utilizzato
function getBrowser() {
$browser = array (
'MSIE 7.0' => 'Internet Explorer 7.0',
'MSIE 6.0' => 'Internet Explorer 6.0',
'MSIE 5.0' => 'Internet Explorer 5.0',
'Firefox' => 'FireFox',
'Opera' => 'Opera',
'Lynx' => 'Lynx',
'Konqueror' => 'Konqueror',
'bot' => 'Bot',
'Google' => 'GoogleBot',
'slurp' => 'Bot',
'scooter' => 'Bot',
'spider' => 'Bot',
'infoseek' => 'Bot',
'Nav' => 'Netscape',
'Gold' => 'Netscape',
'x11' => 'Netscape',
'Netscape' => 'Netscape'
);
foreach ($browser as $chiave => $valore) {
if (strpos($_SERVER['HTTP_USER_AGENT'], $chiave)) {
return $valore;
}
}
return 'Unknown';
}
// Ritorna il sistemo operativo utilizzato
function getSistemaOperativo() {
$os = array (
'Windows NT 6.0' => 'Windows Vista',
'Windows NT 5.1' => 'Windows XP',
'Windows NT 5.0' => 'Windows 2000',
'Windows NT 4.90' => 'Windows ME',
'Win95' => 'Windows 95',
'Win98' => 'Windows 98',
'Windows NT 5.2' => 'Windows NET',
'WinNT4.0' => 'Windows NT',
'Mac' => 'Mac',
'PPC' => 'Mac',
'Linux' => 'Linux',
'FreeBSD' => 'FreeBSD',
'SunOS' => 'SunOS',
'Irix' => 'Irix',
'BeOS' => 'BeOS',
'OS/2' => 'OS/2',
'AIX' => 'AIX',
);
foreach ($os as $chiave => $valore) {
if (strpos($_SERVER['HTTP_USER_AGENT'], $chiave)) {
return $valore;
}
}
return 'Unknown';
}
echo 'Sistema operativo: ' . getSistemaOperativo() . ' e Browser: ' . getBrowser() . '';
?>
Lascia un commento
Copyright © 2005 - 2010 :: ianaz - created by Silvio Rainoldi