% Function ChkInvaildWord(Words) Const InvaildWords="*|@|%|!|#|'|," ChkInvaildWord=True InvaildWord=Split(InvaildWords,"|") inWords=LCase(Trim(Words)) For i=LBound(InvaildWord) To UBound(InvaildWord) If Instr(inWords,InvaildWord(i))>0 Then ChkInvaildWord=True Exit Function End If Next ChkInvaildWord=False End Function %> <% //验证字符 If Request("action")="login" Then ErrStr="" If Trim(Request.Form("com_uid"))="" Then ErrStr=ErrStr+"用户名不能为空!" End If If Trim(Request.Form("com_pwd"))="" Then ErrStr=ErrStr+"密码不能为空!" End If If ChkInvaildWord(Request.Form("com_uid"))=True Then ErrStr=ErrStr+"用户名不能输入特殊字符!" End If If ChkInvaildWord(Request.Form("com_pwd"))=True Then ErrStr=ErrStr+"密码不能输入特殊字符!" End If //判断登陆 If ErrStr="" Then UID=Trim(Request.Form("com_uid")) PWD=Trim(Request.Form("com_pwd")) Sql0="Select id From userlist Where username='"&UID&"' And userpwd='"&PWD&"'" Set Rs0=Server.CreateObject("Adodb.Recordset") Rs0.Open Sql0,Conn,1,1 If Rs0.Eof Then ErrStr=ErrStr+"用户名密码出错!" Else ComNo=rs0("id") end if Rs0.Close:Set Rs0=Nothing end if If ErrStr="" Then Session("userid")=ComNo Response.Redirect("commercial/default.html") End If end if %>
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
|
|