asp判断IP属于国内还是国外跳转到不同页面

发布:2013-09-29 13:01   点击872次   评论:0

http://blog.163.com/chenzhenhua_007/blog/static/128492649201341494851831/
PHP IP地址函数ip2long(),long2ip()  

中国各省市IP地址段
http://ips.chacuo.net/
http://elifebike.com/v2013/wap/ip-api.asp?ip=14.222.24.125

IP-API
http://www.yodao.com/smartresult-xml/search.s?jsFlag=true&keyfrom=163.com&event=fYodaoCallBack&type=ip&q=222.128.1.2
http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=222.128.1.2
http://w.1616.net/chaxun/iptolocal.php?ip=14.222.24.125
http://my.oschina.net/quttap/blog/80437

中国各省市IP地址段
http://ips.chacuo.net/
http://www.baidu.com/s?wd=14.222.24.125
http://wenwen.soso.com/z/q212089523.htm

asp判断IP属于国内还是国外跳转到不同页面 
我有一个双语的企业站,现在想实现用过asp判断访问者的IP,判断IP是属于国内的还是国外的,如果是国内的跳转到ch/index.asp,如果是国外IP则跳转到en/index.asp,请问这个功能如何实现???
 
是否需要一个判断IP的ip.mdb数据库,我有一个纯真版的ip数据库,可以用吗???

用IP太过于麻烦了,并且还要知道国家的IP段,非常不实际,你可以直接验证浏览器所用的字符集,中国人用一般就用中文的,可以这样:
[%
IF Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")="zh-cn"  THEN
Response.Redirect("ch/index.asp")
ELSE
Response.Redirect("en/index.asp")
End if
%]
追问:
大侠,我只用了你的这段代码后,为什么我是中文的却直接转到英文页面去了呀???
回答:
你用RESPONSE.WRITE Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
看看是什么
追问:
zh-CN
回答:
那你就LCase(Request.ServerVariables("HTTP_ACCEPT_LANGUAGE"))="zh-cn"

case "zh-cn" response.write "中文(中国)" 
case "zh-tw" response.write "中文(台湾)" 
case "zh-mo" response.write "中文(澳门特别行政区)" 
case "zh-hk" response.write "中文(香港特别行政区)" 
case "zh-sg" response.write "中文(新加坡)" 
case "en-us" response.write "英语(美国)" 
case "ja" response.write "日语" 
case "ko" response.write "朝鲜语"

==============================================

http://www.nowamagic.net/php/php_JudgeIP.php
PHP判断来访国内外IP

关于 GitHub 导航 部门 反馈

提示:`/home.php`入口数据仅为演示功能,不构成任何交易凭证,也不承担相关风险和责任!

Copyright © 2011-2018 xxxxx.com All rights reserved.

Run:4.166/33.531(ms); 7(sql)/2.879(MB); comm:news/detail; Upd:2024-04-19 08:13:05