Include_once ('./qqwry.php tutorial ');
$QQWry =new Qqwry;
function Get_real_ip () {
$ip =false;
if (!empty ($_server["HTTP_CLIENT_IP"])) {
$ip = $_server["Http_client_ip"];
}
if (!empty ($_server[' http_x_forwarded_for ')) {
$ips tutorial = Explode (",", $_server[' http_x_forwarded_for '));
if ($IP) {array_unshift ($ips, $ip); $ip = FALSE;}
for ($i = 0; $i < count ($ips); $i + +) {
if (!eregi ("^ (10|172.16|192.168).", $ips [$i])) {
$ip = $ips [$i];
Break
}
}
}
return $IP;
}
function Is_ip ($STR) {
$ip = Explode (".", $str);
if (count ($ip) <4 | | count ($IP) >4) return 0;
foreach ($ip as $ip _addr) {
if (!is_numeric ($ip _addr)) return 0;
if ($ip _addr<0 | | | $ip _addr>255) return 0;
}
return 1;
}
if ($_post[' IP ']) {
$ip =$_post[' IP '];
Preg_match ('/(w|-) +.) +[a-z]{2,4}/i ', $ip)? $ip =gethostbyname ($IP): $ip;
if (Is_ip ($IP)) {
$IFERR = $QQWry->qqwry ($IP);
echo "ip: of your query." $ip. " <br>ip Detailed Address: ". $QQWry->country. $QQWry->local. " <br/> ";
$IPL = $QQWry->country;
}else
{
echo "You enter like Mars IP, this site can not query."
}
}else{
$ip =get_real_ip ();
if (($_server["http_client_ip"]) or ($_server[' http_x_forwarded_for ')) {
$IFERR = $QQWry->qqwry ($IP);
echo "Your real P is". $ip. " from $QQWry->country $QQWry->local. " <br/> ";
$IPL = $QQWry->country;
$ip =$_server[' remote_addr '];
$IFERR = $QQWry->qqwry ($IP);
echo "Your proxy IP is". $ip. " from $QQWry->country. $QQWry->local;
}
else{
$ip =$_server[' remote_addr '];
$IFERR = $QQWry->qqwry ($IP);
echo "Your IP is". $ip. " from $QQWry->country. $QQWry->local;
$IPL = $QQWry->country;
}
}