如何对表单所填的内容进行验证?
如何对表单所填的内容进行验证?
<%'------获取传递过来的表单数据
userName_form=Trim(Request.Form("userName"))
passWord_form=Trim(Request.Form("passWord"))
'------判断登陆的帐号与密码的合法性
userSql="select * from userInfo where userName='"&userName_form&"'"
rs.open userSql,conn,1,1
If rs.eof Then
errmsg="不存在此用户,请注册!"
returnURL="register.htm"
ElseIf rs("passWord")<>passWord_form Then
errmsg="密码不正确,请重新登陆!"
returnURL="default.htm"
ElseIf Instr(Application("online_name"),userName_form) Then
errmsg="该帐号正在被使用!登录失败!"
returnURL="default.htm"
Else
Session("userName")=userName_form
conn.Execute("update userInfo set visitCount="&rs("visitCount")+1&" where userName='"&userName_form&"'")
errmsg="登录成功!进入论坛!"
returnURL="mainPage.asp"
End If
Set rs=Nothing
Set conn=Nothing
%>