请帮我的注册页面过滤一些非法提交

来源:百度知道 编辑:UC知道 时间:2024/05/16 22:30:12
<%
if Request.form("Submit")<>"" then
u=replace(Request.form("username"),"'","")
u1=u
p=replace(Request.form("passwd"),"'","")
e=replace(Request.form("eml"),"'","")
if u="" or p="" or e="" then errors ("用户名/密码/Email必须填写")
sql="select ID from DB_Battle_Event where ID='"&u&"'"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,3,1
if rs.recordcount>0 then
rs.close
conn.close
set rs=nothing
set conn=nothing
errors("用户名已经存在请换一个名字")
end if
rs.close
set rs=nothing
sql="insert into DB_Battle_Event (ID,Passwd,Name,Resident,bill,mobile,Address,zip,Email,Member,Host_Addr,Today,Chg_server_id) values ('"&u&"','"&p&"

<%
if Request.form("Submit")<>"" then
u=replace(Request.form("username"),"'","")
u1=u
p=replace(Request.form("passwd"),"'","")
e=replace(Request.form("eml"),"'","")
if u="" or p="" or e="" then errors ("用户名/密码/Email必须填写")
if Len(u) < 5 then errors ("您的用户名长度不能少于5个字节")
if Len(u) > 10 then errors ("您的用户名长度不能超过10个字节")
if instr(Request.QueryString("u"),u)=0 then errors ("用户名中不能含有URL所不能传送的特殊符号")
if instr(e,"@")=0 then errors ("您的电子邮箱地址填写错误")
errorchar=array(" ","?","?","?","","","|","`","#","%","&","+")
for i=0 to ubound(errorchar)
if instr(u,errorchar(i))>0 the