View file include/ip.php

File size: 1.73Kb
<?php 
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);
if(getenv(HTTP_X_FORWARDED_FOR)) { $IP = getenv(HTTP_X_FORWARDED_FOR); } 
elseif(getenv(HTTP_CLIENT_IP)) { $IP = getenv(HTTP_CLIENT_IP); } 
else { $IP = $REMOTE_ADDR; }
$os_search = array("Windows 2000", "Windows 98", "Windows 95", "Win95", "Win98", "Windows NT 4.0", "Windows NT 5.0", "Windows NT 5.1", "Windows XP", "Windows ME", "WinNT", "Mac_PowerPC", "Macintosh", "SunOS", "Linux", "Windows NT");
$os = array("Windows 2000", "Windows 98", "Windows 95", "Windows 95", "Windows 98", "Windows NT 4.0", "Windows NT 5.0", "Windows XP", "Windows XP", "Windows ME", "WinNT", "Macintosh", "Macintosh", "SunOS", "Linux", "WinNT");
		$browser_search = array("compatible; MSIE 6.0; Windows NT 5.1; MSN 6.1; MSNbMSFT; MSNmnl-nl; MSNc00; v5m", "MSIE 6.0", "MSIE 5.5", "MSIE 5.0", "MSIE 4.0","Opera","Konqueror","Mozilla/5", "Mozilla/4", "Mozilla");
		$browser = array("MSN Explorer", "Internet Explorer 6","Internet Explorer 5.5", "Internet Explorer 5", "Internet Explorer 4", "Opera","Konqueror","Netscape 6.x", "Netscape 4.x", "Netscape");
$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 = "Other"; }
$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 = "Other"; }
echo "Ваш IP адрес :<strong> $IP </strong>!<br/>";
//echo "Ваш оператор :<strong> $OPSYS </strong>!<br>";
//echo "Ваш браузер :<strong> $IBROWSER </strong>!<br> ";
?>