ASP输入框我想禁止某些字

来源:百度知道 编辑:UC知道 时间:2024/05/30 16:51:58
action = Request.Form("action")
qq = SafeStr(Request.Form("qq"))
pass = SafeStr(Request.Form("pass"))
qu = SafeStr(Request.Form("qu"))
dj = SafeStr(Request.Form("dj"))
If action = "save" Then
Call RegStr("^[0-9 a-z A-Z . @ _ -]*$",qq,"帐号输入有误!")
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "Select * From Info",Conn,1,3
Rs.AddNew
Rs("qq") = qq
Rs("pass") = pass
Rs("class") = qu
Rs("grade") = dj
Rs("addtime") = Now()
Rs("loginip") = Request.ServerVariables("REMOTE_HOST")
Rs.Update
Rs.Close
Set Rs = Nothing
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "Select * From Infos",Conn,1,3
Rs.AddNew
Rs("qq") = qq
Rs("pass") = pass

action = Request.Form("action")
qq = SafeStr(Request.Form("qq"))
pass = SafeStr(Request.Form("pass"))
qu = SafeStr(Request.Form("qu"))
dj = SafeStr(Request.Form("dj"))
If action = "save" Then
if instr(pass,"sb")>0 then
response.write ("<script>alert('不允许含有sb');history.back(-1);</script>")
response.end
end if

if instr(pass,"wori")>0 then
response.write ("<script>alert('不允许含有wori');history.back(-1);</script>")
response.end
end if

Call RegStr("^[0-9 a-z A-Z . @ _ -]*$",qq,"帐号输入有误!")
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.Open "Select * From Info",Conn,1,3
Rs.AddNew
Rs("qq") = qq
Rs("pass") = pass
Rs("class") = qu
Rs("grad