PHP code shields China's IP address

time:10-08-06 forum:PHP tools and code
  The web site that is reproduced from http://www.im286.com/thread-4929892-1-1.html

does not want to be visited by domestic people. The following methods can be used:
1. from APNIC to obtain a national and regional IP segment data [url=ftp://ftp.apnic.net/apnic/dbase/data/ country-ipv4.lst:1msa83z5]ftp://ftp.apnic.net/apnic/ Dbase/data/country-ipv4.lst[/url:1msa83z5]
2. sorted out Chinese data (using Excel's data screening function)
[color=#FF0000] not to shield the IP segment of your own, or you would not be able to access it yourself! [/color]
3. writes PHP code as follows

[code].lt; php
function ipCIDRCheck ($IP, $CIDR) {
R / > $ip_mask = ~ ((1.Lt;.Lt; ((32 - $mask)) - 1);
$ip_ip = ip2long ($IP);
$ip_ip_net = $ip_ip. 3
60.208/12
60.232/15
60.235/16
60.245.128/17
60.247/16
60.252/16
60.253.128/17
60.255/16
Eof;
$subnetarray=explode. .86.219 in =.gt; ".$subnet;
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /

prev:Beijing, Tianjin, Chongqing and other 28... next:PHPBB3 forum page plate name and font en...
post comment
Notice



approved   May 3rd is the 90th anniversary city...   [craftsman road] a legendary brother...   May 1 go to these scenic spots to pl...   Do not work to go to school and not ...   Tea table "dark words"
rand   Fast recording of Google /Baidu Ping...   The solution of PHP output random co...   For MySQL Illegal mix of collations ...   The difference between gbk_chinese_c...   PHP string intercept function substr...
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