PHP code for different cities from IP

time:11-02-10 forum:PHP tools and code
  Reprinted from http://www.im286.com/thread-4175139-1-1.html

[code].lt;

//php

$user_IP =

$user_IP = R_IP)? $user_IP: $_SERVER.#91;.Quot; REMOTE_ADDR.quot;.#93;



//echo $user_IP;

//

//===================================

return'IP. Br />
}




$DataBegin = FREAD ($fd, 4);

$DataEnd = FREAD ($fd, 4);

= = > = 2, 32. Ipend.Lt; 0) $ipend = pow (2, 32);

$ipAllNum = ($ipend - $ipbegin) / 71;


= 0; M {

$Middle= intval (($EndNum $BeginNum) / 2);


/ / / / / / / / / / / / / / / / / / / / / / / / / / / / > = > 4. Ata1).Lt; 4) {

Fclose ($fd);

return'System Error'. / > if ($ip1num.Lt; 0) $ip1num = pow (2, 32);



= > =



"}



/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / $DataSeek = implode ('', unpack ('L', $DataSeek.chr (0)));

fseek ($fd, $DataSeek);

'L' = > 4). }

$ip2num = implode ('', unpack ('L', $ipData2));

if ($ip2num.Lt; 0). Fclose ($fd);

return'Unknown';

}

$BeginNum = $Middle; 1);

if ($ipFlag = = Chr (1)) {

$ipSeek = FREAD ($fd, 3);

3. .chr (0)));

fseek ($fd, $ipSeek);

$ipFlag = FREAD ($fd, 1); >
return'System Error';

}

$ipFlag = FREAD ($fd, 1);
> = > 3. />
return'System Error';

}

$AddrSeek2 = implode (' ', unpack ('L', >)); R />


while (($char = FREAD ($fd, 1))! = Chr (0))

$ipAddr2. = Chr = Chr (0))

$ipAddr1. = $char;

} else {

fseek ($fd, 1)! = = > = 1. If ($ipFlag = = Chr (2)) {

$AddrSeek2 = FREAD ($fd, 3);

if (strlen). Pack ('L', $AddrSeek2.chr (0)));

fseek ($fd, $AddrSeek2);

else {
}

Fclose ($fd);




$ipaddr = preg_replace ('/^s*/is', '', $ipaddr);

}



return $ipaddr;

}

?.gt; Br />
}

else if (.Quot;.Quot; Guangdong province.Quot;).Gt; =0) {http://update.cz88.net/soft/qqwry.rar
failure to download
we only use the QQWry.Dat
2. in it to save my code as ip.php
4. to insert.Lt in the required page; script src=.quot; /ipcity/ip.php.quot;.Gt;.Lt; /script.gt;


window.location.href=.quot; http://www.11jn.com/train/? Jump to the province or city.Quot;;

}[/code]

supplementation: This is the author's own online search of PHP code, and write their own JS, this PHP is from the discuz code, the efficiency is not much said the
database pure, you must be clear, then the brother's only written JS does not occupy the server resources, throw a brick.

prev:Microsoft IIS Web server Internet Inform... next:HTML
post comment
Notice



approved   A survey of lonely elderly people in...   Salted pickled vegetables are carcin...   Angels don't give up! The brachless ...   A family of four, 30 years of frugal...   20 years ago, the life of Jinan peop...
rand   Put URL shortcuts on the PHP code on...   Cross domain call COOKIES   Implementation of escape decoding fu...   PHP decryption of Unicode coded char...   PHP to get the breakpoint renewal co...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com