我想在登入框中设置,登入失败三次
就让登入框禁止登入30分钟
我把三次累加放session("n")中
我想在登入框中设置,登入失败三次
就让登入框禁止登入30分钟
我把三次累加放session("n")中
大家帮我看看,那里错了
<!--#include file="conn.asp"--> <!--#include file="../md5.asp"--> <%dim admin,password admin=replace(trim(request("admin")),"'","") password=md5(replace(trim(request("password")),"'","")) application("ip")=request.servervariables("REMOTE_ADDR") application("time")=cint(mid(date(),6,2)) session("n")=0 if admin="" or password="" then response.Write "<center><a href=login.asp><font color=red size=2>对不起,登陆失败,请检查您的登陆名和密码</font></a></center>" session("n")=session("n")+1 if session("n")=3 then if application("ip")=request.servervariables("REMOTE_ADDR") and application("time")+30>=cint(mid(date(),6,2)) then response.Redirect "index.asp" end if end if response.end end if set rs=server.CreateObject("adodb.recordset") rs.Open "select * from shop_admin where admin='"&admin&"' and password='"&password&"' " ,conn,1,1 if not(rs.bof and rs.eof) then if password=rs("password") then session("admin")=trim(rs("admin")) session("flag")=int(rs("flag")) session.Timeout=20 rs.Close set rs=nothing response.Redirect "index.asp" else
response.write "<script LANGUAGE='javascript'>alert('对不起,登陆失败!');history.go(-1);</script>" session("n")=session("n")+1 if session("n")=3 then if application("ip")=request.servervariables("REMOTE_ADDR") and application("time")+30>=cint(mid(date(),6,2)) then response.Redirect "index.asp" end if end if end if else response.write "<script LANGUAGE='javascript'>alert('对不起,登陆失败!');history.go(-1);</script>" session("n")=session("n")+1 if session("n")=3 then if application("ip")=request.servervariables("REMOTE_ADDR") and application("time")+30>=cint(mid(date(),6,2)) then response.Redirect "index.asp" end if end if end if
%>