复制代码 代码如下:
$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");
}
?>
$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");
}
?>
关键字词:
相关文章
- thinkphp where中or多个like模糊搜索
- php开启和关闭短标签功能
- php输出所有错误日志信息及其配置和SET方式操作
- window下redis和memache扩展的安装
- phpHeaderHTTP状态码和常用返回头集合大全
- dedecms后台文章发布标题自动生成tags和关键词详解_编程资料分享
- php curl获取header和body内容_编程资料分享
- thinkphp Apache和nginx伪静态重写规则
- php5.5 版本和5.6 file_get_contents curl
- php session_start无法开启和使用Cannot send session cache limiter - headers already sent错误解决方法