1.查询地址
搜狐IP地址查询接口(IP):http://pv.sohu.com/cityjson
1616 IP地址查询接口(IP+地址):http://w.1616.net/chaxun/iptolocal.php
126(地址): http://ip.ws.126.net/ipquery
例如需要屏蔽北京地区的访问,可以这样写126的代码,
<script language='javascript' type='text/javascript' src='http://ip.ws.126.net/ipquery'></script>
<script language='javascript' type='text/javascript'>var province = localAddress['province'];
var city = localAddress['city'];
var tc=1;
if(city.indexOf('北京市') != -1 || province.indexOf('北京市') != -1 ) {
bsgs=1;
window.location.href = "http://www.baidu.com"
} else {
bsgs=0;
}
</script>