谁能帮我看看这段代码?
<%'用户IP限制 function LockIP(sip) dim str1,str2,str3,str4 dim num LockIP=false if isnumeric(left(sip,2)) then str1=left(sip,instr(sip,".")-1) sip=mid(sip,instr(sip,".")+1) str2=left(sip,instr(sip,".")-1) sip=mid(sip,instr(sip,".")+1) str3=left(sip,instr(sip,".")-1) str4=mid(sip,instr(sip,".")+1) if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then else num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1 sql="select count(*) from 9j455noip where ip1 <="&num&" and ip2 >="&num&"" set rs_ip=conn.execute(sql) if rs_ip(0)>0 then LOCKIP=true end if set rs_ip=nothing end if end if end function%> <%if LockIP(Request.ServerVariables("REMOTE_ADDR")) then response.write "<script>alert('您的IP:"&request.servervariables("remote_addr")&"已经被限制不能访问,请和管理员联系');location.href='about:blank'</script><script>window.close();</script>" response.end end if %> <% noip=Request.Servervariables("HTTP_X_FORWARDED_FOR") If noip="" Then noip=Request.Servervariables("REMOTE_ADDR") set rst11=server.createobject("adodb.recordset") sql="select * from 9j455pkip where userip='"&noip&"'" rst11.open sql,conn,1,1 if not rst11.eof and not rst11.bof then response.write "<script>alert('您的IP:"&request.servervariables("remote_addr")&"已经被限制不能访问,请和管理员联系');location.href='about:blank'</script><script>window.close();</script>" response.end end if %> 在9j455noip表中明明是空的表,没有任何ip值的。为什么它还是能够弹出IP被限制,请和管理员联系的窗口。我试过好多次了。用本机127.0.0.1试的。 |