欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

帝國CMS調用新浪iplookup實現(xiàn)根據(jù)ip跳轉到不同域名

  發(fā)布時間:2014-11-26 11:39:42   作者:佚名   我要評論
這篇文章主要為大家介紹了帝國CMS調用新浪iplookup實現(xiàn)根據(jù)ip跳轉到不同域名的方法,涉及第三方接口的調用,是非常實用的技巧,需要的朋友可以參考下

本文實例講述了帝國CMS調用新浪iplookup實現(xiàn)根據(jù)ip跳轉到不同域名的方法。分享給大家供大家參考。

具體實現(xiàn)代碼如下:


復制代碼
代碼如下:

$IP_str=file_get_contents('http://int.dpool.sina.com.cn/iplookup/iplookup.php');
$IP_tmp = explode("\n", $IP_str);
$IPcou=count($IP_tmp)-1;
$IP_tmp1 = explode(" ", $IP_tmp[0]);
if($IP_tmp1[5]){
$user_IP=$IP_tmp1[5];
}else{
$user_IP=$IP_tmp1[4];
}
if($user_IP == '上海'){
header('Location: A.php');
}elseif($user_IP == '北京'){
header('Location: B.php');
}else{
header('Location: C.php');
}

希望本文所述對大家的帝國CMS建站有所幫助。

相關文章

最新評論