zzzcms免费开源建站系统 ZZZcms建站系统

如果出现您IP不在指定城市范围内解决办法


错误提示:502 禁止访问

您IP不在指定城市范围内


错误原因:CSDN的ip查询API关闭,造成无法获取到登陆者ip归属地。


解决方法:替换inc/zzz_main.php文件


或人工替换代码:



function iptocity($ip){
    $json = http_get("http://opendata.baidu.com/api.php?query=$ip&co=&resource_id=6006&oe=utf8");
    $arr = jsonto($json, 1);
    if (isset($arr['data'][0]['location'])) {
        $str= $arr['data'][0]['location'];
        if(ifstrin(	$str,'省') || ifstrin(	$str,'自治区') ){
             $r= '中国 '.$str;
        }
    } else {
		$r= '';
    };
	return $r;
}


对此问题站长对大家说声道歉