<?php
$os = getos();
$agent2 = $_SERVER['HTTP_USER_AGENT'];
function getos(){
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strstr($agent,'Win')){
if(strstr($agent,'NT 5.0') || strstr($agent,'NT5.0') || strstr($agent,'Windows 2000')){ $os = "Windows 2000";
}else if(strstr($agent,'NT 5.1') || strstr($agent,'NT5.1') || strstr($agent,'Windows XP')){$os = "Windows XP";
}else if(strstr($agent,'NT 6.0') || strstr($agent,'NT6.0') || strstr($agent,'Windows Vista')){$os = "Windows Vista";
}else if(strstr($agent,'NT 6.1') || strstr($agent,'NT6.1') || strstr($agent,'Windows 7')){$os = "Windows 7";
}else if(strstr($agent,'Win98') || strstr($agent,'Windows 98')){$os="Windows 98";
}else if(strstr($agent,'NT')) {$os='Windows NT';
}else if(strstr($agent,'Win95') || strstr($agent,'Windows 95')){$os='Windows 95';
}else if(strstr($agent,'Win 9x')) {$os='Windows 95';
}else if(strstr($agent,'WinME') || strstr($agent,'Windows ME')){$os='Windows ME';
}else{$os='Windows (version unspecified)';}
}else if (strstr($agent,'Mac')){$os='Apple Macintosh';
}else if (strstr($agent,'Linux')){$os='Linux';
}else if (strstr($agent,'BeOS')){$os='BeOS';
}else if (strstr($agent,'Unix') || strstr($agent, "HP-ux") || strstr($agent, "X11")){$os='Unix';
}else if (strstr($agent,'SunOS')){$os='SunOS';
}else if (strstr($agent,'FreeBSD')){$os='FreeBSD';
}else if (strstr($agent,'OpenBSD')){$os='OpenBSD';
}else if (strstr($agent,'IRIX')){$os='IRIX';
}else if (strstr($agent,'spider') || strstr($agent,'bot') || strstr($agent,'http') || strstr($agent,'Scooter') || strstr($agent,'WebCopier')){$os='Spiders';
}else{$os='Unspecified';
}
return $os;
}
echo "
<html>
<head>
<title>test..</title>
</head>
<body>
<br>
<h2 align='center'>IP Information</h2>
<center>
Browser Version: $agent2<br />
Cookies Enabled: <script Language=\"JavaScript\">
</script>
<br/>
Platform: $os";
?>