未分类
<?phpfunctiongetAddr(){//获取ipfunctiongetip(){if(!empty($_SERVER["HTTP_CLIENT_IP"])){$cip=$_SERVER["HTTP_CLIENT_IP"];}elseif(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){$cip=$_SERVER["HTTP_X_FORWARDED_FOR"];}elseif(!empty($_SERVER["REMOTE_ADDR"])){$cip=$_SERVER["REMOTE_ADDR"];}else{$cip="";}return$cip;}$ipz=getip();//获取地址$ip=iconv("GB2312","UTF-8",file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=".$ipz));$ip=preg_replace('/\d|\.|\-/is','',$ip);$c=preg_split('/\s+/is',$ip);returnjoin('',$c);}$aa=getaddr();$str=mb_convert_encoding($aa,'gb2312','utf8');//判断地址并跳转if(stripos($str,"随州")){header("Location:http://www.hack001.com/");exit;}else{header("Location:http://www.so.com/");exit;}?>