首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

求ASP判断IP段后进行页面跳转代码解决方法

2012-02-15 
求ASP判断IP段后进行页面跳转代码如果访问者的IP是在68.59.232.0-68.59.236.164这个范围内,页面就跳转到2.

求ASP判断IP段后进行页面跳转代码
如果访问者的IP是在68.59.232.0-68.59.236.164这个范围内,页面就跳转到2.asp

[解决办法]
<%
Dim userip,checkstr
userip = Request.ServerVariables( "HTTP_X_FORWARDED_FOR ")
If userip = " " Then
userip = Request.ServerVariables( "REMOTE_ADDR ")
End If
If Left(userip,8)= "68.59.23 " Then
checkstr=CDbl(Mid(userip,9,5))
if checkstr> =2.0 and checkstr <=6.164 then
response.redirect( "2.asp ")
end if
else
response.redirect( "1.asp ")
end if
%>

热点排行