本文关键字词:自定义伪静态,栏目目录伪静态,内容目录伪静态,帝国cms伪静态,SEO栏目优化......
2023-05-18 74
本文实例讲述了帝国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'); }
希望本文所述对大家的帝国CMS建站有所帮助。
以上方法由办公区教程网编辑摘抄整理自互联网可供大家参考!
相关文章
本文关键字词:自定义伪静态,栏目目录伪静态,内容目录伪静态,帝国cms伪静态,SEO栏目优化......
2023-05-18 74