' '================================= %> <% dim sql,rs dim username,password,CheckCode username=replace(trim(request("username")),"'","") password=replace(trim(Request("password")),"'","") CheckCode=replace(trim(Request("CheckCode")),"'","") if UserName="" then FoundErr=True ErrMsg=ErrMsg & "
用户名不能为空!
" end if if Password="" then FoundErr=True ErrMsg=ErrMsg & "
密码不能为空!
" end if if CheckCode="" then FoundErr=True ErrMsg=ErrMsg & "
验证码不能为空!
" end if if session("CheckCode")="" then FoundErr=True ErrMsg=ErrMsg & "
你登录时间过长,请重新返回登录页面进行登录。
" end if if CheckCode<>CStr(session("CheckCode")) then FoundErr=True ErrMsg=ErrMsg & "
您输入的确认码和系统产生的不一致,请重新输入。
" end if if FoundErr<>True then password=md5(password) set rs=server.createobject("adodb.recordset") sql="select * from Bs_User where password='"&password&"' and username='"&username&"'" rs.open sql,conn,1,3 if rs.bof and rs.eof then FoundErr=True ErrMsg=ErrMsg & "
用户名或密码错误!!!
" else if password<>rs("password") then FoundErr=True ErrMsg=ErrMsg & "
用户名或密码错误!!!
" else rs("LastLoginIP")=Request.ServerVariables("REMOTE_ADDR") rs("LastLoginTime")=now() rs("LoginTimes")=rs("LoginTimes")+1 rs.update session.Timeout=SessionTimeout session("Name")=rs("username") session("Aleave")="check" rs.close set rs=nothing call CloseConn() Response.Redirect "Default.asp" end if end if rs.close set rs=nothing end if if FoundErr=True then call WriteErrMsg() end if call CloseConn()
" & vbcrlf strErr=strErr & "" & vbcrlf response.write strErr end sub %>
回答2:
<% str=request.queryString("你的输入框") if IsNumeric(str)=true and len(str)=6 and str="136900" Then Response.Write("") else response.Write "" response.End() %>