ASP 登陆次数记录问题
为了实现管理员登陆次数的记录,我的用户密码验证页面是这样写的,可LoginNum字段值始终为0,自己不加,请问我的代码哪写错了,请大家帮忙改下!!
<%
Dim Usr,Pwd,rs
Usr=Request.form("admin") '从表单获得数据
Pwd=Request.form("password") '同上
if (Usr<>"") and (Pwd<>"") then '判断数据为非空
Usr=Replace(Replace(Usr,"'",""),"or","") '嵌套了两个replace函数,过滤特殊字符
Pwd=Replace(Replace(Pwd,"'",""),"or","")
if cstr(Session("GetCode"))<>cstr(Trim(Request("code"))) then
Response.Write("<script>alert(""错误:\n您输入的确认码和系统产生的不一致,请重新输入。\n返回后请刷新登录页面后重新输入正确的信息\n"");location.href=""index.asp"";</script>")
Response.End
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from admin where admin='" & Usr & "' and password='"& Pwd &"'",conn,1,3
if rs.eof and rs.bof then
response.write"<script language=javascript>alert('认证不通过,该信息可能不真实。');"
response.write"javascript:history.go(-1)</script>"
response.end
else
rs("LoginNum")=rs("LoginNum")+1
session("userid")=rs("admin")
session("adminuser")=rs("admin")
session("password")=rs("password")
session("aleave")=rs("aleave")
session("userkey")=rs("userkey")
session("login")=true
response.redirect "manage.asp"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
else
response.redirect "index.asp"
end if
%>
追问:....
rs("LoginNum")=rs("LoginNum")+1 rs.update
session("userid")=rs("admin")
...
这样吗?提示语句未结束!