有道搜索和IP138的IP的API接口(PHP应用)_php教程-查字典教程网 "/>
有道搜索和IP138的IP的API接口(PHP应用)
有道搜索和IP138的IP的API接口(PHP应用)
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:0){header('HTTP/1.1301MovedPermanently');header("Location:htt...

复制代码 代码如下:

<?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=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.jb51.net");

}

?>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新php教程学习
    热门php教程学习
    编程开发子分类