php 根据IP跳转地区
<?php
/*
*Powered by Aiens
*/
require dirname(__FILE__).’/include/common.inc.php’;
require dirname(__FILE__).’/a_area/a_area.inc.php’;
$clientip=$_SERVER[“REMOTE_ADDR”];
$clientcity=convertip($clientip);
$sql=”SELECT * FROM `phpcms_area`”;
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result)){
if (findstr($clientcity,”$row[name]”)){
//true; out.print(“$row[name]”);
header(“Location:http://phpcms/area.php?areaid=$row[areaid]”);
}else{
//false out.print(“unknow area!”);
header(“Location:http://phpcms/”);
}
}
?>
代码下载:
http://yunpan.cn/ccGAADJgcs9Xu 访问密码 9669
转载请注明:苏demo的别样人生 » php 根据IP跳转地区