Copyright @ 2015-2024 织梦园 版权所有 Power by DedeCms
鲁ICP备15039853号-2

模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
$ip = getIp();//dede自带的查询IP功能,直接调用 $res1 = file_get_contents("http://ip.taobao.com/service/getIpInfo.php?ip=$ip"); $res1 = json_decode($res1); $useraddre = $res1->data->region; $useraddre = mb_convert_encoding($useraddre, "GBK", "UTF-8"); $dzcity = "北京"; $contra= strstr($useraddre,$dzcity); if(!emptyempty($contra)){ //南昌的,跳转到这里 header("Pragma: no-cache"); header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); header('HTTP/1.1 301 Moved Permanently'); header("Location: http://www.yourweb.com/"); exit; } |