Home > Backend Development > PHP Tutorial > 有道搜索和IP138的IP的API接口(PHP应用)_php实例

有道搜索和IP138的IP的API接口(PHP应用)_php实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:25:08
Original
1077 people have browsed it
复制代码 代码如下:

$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);//此代码为有道ip库
if(strpos($ipinfo,'北京') > 0) {
header('HTTP/1.1 301 Moved Permanently');
header("Location: http://www.php.net");
}
?>
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
IP address
From 1970-01-01 08:00:00
0
0
0
nginx ban ip problem
From 1970-01-01 08:00:00
0
0
0
Linux static ip does not take effect
From 1970-01-01 08:00:00
0
0
0
javascript - node get ip address
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template