帝国CMS二次开发新浪iplookup根据ip跳转到不同域名
$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');
}
?>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


