<?php/*+--------------------------------------------++程序授权说明 ++作者:森林 ++IP库:淘宝网 ++整理收集:https://www.22ba.com ++--------------------------------------------+*///-------------------------函数封装------------------------------------function ipdy($ipaddr) {$oo0ooo=base64_decode('aHR0cDovL2lwLnRhb2Jhby5jb20vc2VydmljZS9nZXRJcEluZm8ucGhwP2lwPQ==');$ipInfoApi= $oo0ooo.$ipaddr;$areaInfo= file_get_contents($ipInfoApi);$areaInfo= json_decode($areaInfo);$ipjg=$areaInfo->data->country.$areaInfo->data->area.$areaInfo->data->region.$areaInfo->data->city.$areaInfo->data->isp;$ipjg=iconv('UTF-8','GBK',$ipjg);return $ipjg;}//----------------IP-----------function get_real_ip(){$ip=false;if(!empty($_SERVER["HTTP_CLIENT_IP"])){$ip = $_SERVER["HTTP_CLIENT_IP"];}if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {$ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']);if ($ip) { array_unshift($ips, $ip); $ip = FALSE; }for ($i = 0; $i < count($ips); $i++) {if (!eregi ("^(10│172.16│192.168).", $ips[$i])) {$ip = $ips[$i];break;}}}return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);}//---------------------------------$ip=get_real_ip();$ip_str=ipdy($ip)?>
<?php/*+--------------------------------------------++程序授权说明 ++作者:森林 ++IP库:淘宝网 ++整理收集:https://www.22ba.com ++--------------------------------------------+*/include("ip_config.php");//------------------------------以下根据情况修改------------------------if(stristr($ip_str,'北京') || stristr($ip_str,'广东')){exit("感谢来访,我们正在建设中,需要很长时间。请过些时候来访问。");}?>
下一篇:百度移动网站建设常见问题集锦