IP数据库格式是 ipdb,望大神解决难题
自动判别访问的IP去对照IP库,非中国IP禁止访问或者跳转404
这是当前识别页我自己写的代码 而这个识别后去对比IP我不会写
<%
ip=Request.ServerVariables("REMOTE_HOST")
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "Select * From cip where ip='"&ip&"'",Conn,1,3
if rs.eof or rs.bof then
Rs.AddNew
Rs("time") = Now()
Rs("ip") = Request.ServerVariables("REMOTE_HOST")
Rs("ci")=1
else
rs("ci")=rs("ci")+1
end if
Rs.Update
Rs.Close
Set Rs = Nothing
%>
<%
ip=Request.ServerVariables("REMOTE_HOST")
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "Select * From cip where ip='"&ip&"' and ci>1",Conn,1,1
if not rs.eof then
response.Write"<script>location.href='404.html'</script>"
else
response.Write"<script>location.href='pension.html'</script>"
end if
rs.close
set rs=nothing
conn.close
%> |