Home  >  Article  >  Web Front-end  >  线路分流自动智能跳转代码,自动选择最快镜像网站(js)_javascript技巧

线路分流自动智能跳转代码,自动选择最快镜像网站(js)_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:59:561359browse

JS脚本无数据库代码

复制代码 代码如下:



JS脚本数据库代码
复制代码 代码如下:

'版权所有
On Error Resume next
dim conn,dbpath,UserIP
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("IP.mdb")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库正在更新中,请稍后再试!"'注释,需要把这几个字翻译成英文。
Response.End
End If
myip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If myip = "" Then myip = Request.ServerVariables("REMOTE_ADDR")
tempip=myip
myip = Split(myip,".")
if Ubound(myip)=3 then
For i=0 To Ubound(myip)
myip(i)=left(myip(i),3)
if isnumeric(myip(i)) then
myip(i)=cint(myip(i))
else
myip(i)=0
end if
next
myipnumeber=myip(0)*256*256*256+myip(1)*256*256+myip(2)*256+myip(3)
sql="select addr from ip where ip1="&myipnumeber
set rs1=conn.execute(sql)
if not rs1.eof then
response.redirect "http://www.***.com" '是网通的话则跳转到网通的网址去,自己修改为自己的网站
Else
response.redirect "http://www.****.com" '不是网通的则跳转到的网址,自己修改,不废话了
end if
rs1.close
set rs1=nothing
conn.close
set conn=nothing
end if%>

如:
复制代码 代码如下:



标题








Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn