$user = new BrowserInfo($_SERVER['HTTP_USER_AGENT']);
$ip = $_SERVER['REMOTE_ADDR'];
$port = $_SERVER['REMOTE_PORT'];
$host = gethostbyaddr($ip);
$connection = $_SERVER['HTTP_CONNECTION'];
$type = $_SERVER['SERVER_PROTOCOL'];
$whois = whois_info($_SERVER['REMOTE_ADDR']);
$land = $whois['country'];
$provider = $whois['netname'];
$orgname = $whois['orgname'];
print <<
OS: | $user->OS $user->OS_Version |
Browser: | $user->Browser $user->Browser_Version |
IP: | $ip |
Host: | $host |
Port: | $port |
Verbindungsart: | $connection |
Typ: | $type |
Provider: | $orgname $provider |
Land: | $land |
END;
/*
$browser = get_browser(null, true);
print_r($browser);
*/
function whois_info($ip) {
$error = array(
"We do not refer for",
"No match",
"No entries found",
"whois_request address space is assigned at various other places in",
"These addresses have been further assigned to users",
"Not allocated",
"Not assigned",
"The country is really worldwide",
"whois_request IP address range is not registered",
"Details of networks in whois_request range are not registered",
"whois_request network range is not allocated",
"The object shown below is NOT in the",
"Allocated to",
"Please use the whois server at",
"no entries found",
"invalid",
);
$server = array(
"whois.ripe.net",
"whois.lacnic.net",
"whois.arin.net",
"whois.apnic.net",
"whois.internic.com"
);
for ($s = 0; $s < count($server); $s++) {
$output = "";
$next_server = "";
if ($conn = fsockopen ($server[$s], 43, $errno, $errstr, 30)) {
fputs($conn, $ip."\r\n");
while(!feof($conn)) { $output .= fgets($conn,4096); }
fclose($conn);
}
for ($e = 0; $e < count($error); $e++) {
if (preg_match("/$error[$e]/i", $output)) { $next_server = "ok"; }
}
if (empty($next_server)) {
$msg .= nl2br($output);
$tmparr=explode("
", $msg);
foreach ($tmparr as $value) {
$tmpvalue=explode(":", $value);
$key=trim($tmpvalue[0]);
$znach=trim($tmpvalue[1]);
if (strtolower($key)=='country') { $whois_request['country'] = $znach; }
if (strtolower($key)=='netname') { $whois_request['netname'] = $znach; }
if ((strtolower($key)=='orgname') || (strtolower($key)=='descr')) { $whois_request['orgname'] = $znach; }
};
return ($whois_request);
}
}
}
?>