根据IP地址自动判断转向分站的代码
function getipvalue(clientip) 得到客户端 的ip转换成长整型,返回值getipvalue
on error resume next
dim strip, array_ip
strip=0
array_ip = split(clientip,".")
if ubound(array_ip)<>3 then
getipvalue=0
exit function
end if
for i=0 to 3
strip=strip+(cint(array_ip(i))*(256^(3-i)))
next
getipvalue=strip
if err then getipvalue=0
end function
clientip=request.servervariables("remote_host")
ipvalue=getipvalue(clientip)
strsql="select top 1 city from [ipaddress] where "&ipvalue&" between ip1 and ip2"
set rsip=conn.execute(strsql)
if rsip.bof and rsip.eof then
urlcity="未知"
else
urlcity=rsip.fields.item("city").value
end if
if instr(urlcity,"广州")<>0 then response.redirect("https://code.rdxx.com")
if instr(urlcity,"深圳")<>0 then response.redirect("https://moban.rdxx.com")
if instr(urlcity,"上海")<>0 then response.redirect("https://font.rdxx.com")
由于ip库超过1m,所以上传不了,ip库网上很多。上面只是其中一种方法.