Youdao search and IP138 ip api (PHP application ). Copy the code as follows :? Php $ myip $ _ SERVER [REMOTE_ADDR]; ip138wap. ip138.comip. asp? Ipwww. myolnet. comyoudaowww. You Dao. comsmartresult-xmlsearch.s? Type
The code is as follows:
$ Myip = $ _ SERVER ["REMOTE_ADDR"];
/Ip138 http://wap.ip138.com/ip.asp? Ip = www.myolnet.com
// Youdao http://www.youdao.com/smartresult-xml/search.s? Type = ip & q = ip
$ Ipinfo = fcontents ("http://www.youdao.com/smartresult-xml/search.s? Type = ip & q = ". $ myip); // This code is a ip library
If (strpos ($ ipinfo, 'Beijing')> 0 ){
Header ('http/1.1 301 Moved Permanently ');
Header ("Location: http://www.jb51.net ");
}
?>
The http://www.bkjia.com/PHPjc/326268.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/326268.htmlTechArticle code is as follows :? Php $ myip = $ _ SERVER ["REMOTE_ADDR"]; // ip138 http://wap.ip138.com/ip.asp? Ip = www.myolnet.com // youdao http://www.youdao.com/smartresult-xml/search.s? Type...