为了让广大客户端更快速的访问网站,一般一个大型网站会有很多分站,让客户端访问相应的分站,让客户有更好的体验,这就要用到根据客户端IP地址转向不同的分站。这里面要用到IP数据库,可到网上去下载。IP数据库在此主要用途是根据得到的IP,找到此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("http://code.knowsky.com")
end if
if instr(UrlCity,"深圳")<>0 then
response.Redirect("http://moban.knowsky.com")
end if
if instr(UrlCity,"上海")<>0 then
response.Redirect("http://font.knowsky.com")
end if
wholesale china product ,this is cheap china product,china electronics
wholesale retail company from china
achinaseller.com is a professional wholesale retail company, having our own factory with 5 years of wholesale retail experience. Achinaseller.com is also cooperating closely with many factories, so the price that we offer to the consumer is directly from the Chinese Factory. Without leaving your home, you could order your own products at achinaseller.com at the lowest price.
We service over 100,000 registered buyers, delivering to virtually every country in the world. Our warehouse and office are staffed by a young team of Chinese and Western staff.
Happy AchinaSeller buyers include frequent wholesale importers, famous ecommerce websites, eBay powersellers, retail shops and startup home import businesses. On a daily basis, we serve corporate buyers, drop-ship experts, home business Moms, and small bussiness wholesaler
We service over 100,000 registered buyers, delivering to virtually every country in the world. Our warehouse and office are staffed by a young team of Chinese and Western staff.
Happy AchinaSeller buyers include frequent wholesale importers, famous ecommerce websites, eBay powersellers, retail shops and startup home import businesses. On a daily basis, we serve corporate buyers, drop-ship experts, home business Moms, and small bussiness wholesaler
没有评论:
发表评论