求助 这段代码 怎么限制注册用户名 不让使用特殊符号来注册
<%mm=request.Form("mm")
if mm=1 then
username=request.Form("username")
password=request.Form("password")
passwordto=request.Form("passwordto") name=request.Form("name")
oicq=request.Form("oicq")
alipay=request.Form("alipay")
id=request.cookies("wh")
if username="" or password="" or passwordto="" or name="" or oicq="" or alipay="" then
Response.write "<SCRIPT language=JavaScript>alert('请将信息填写完整!');"
Response.Write "this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
if password<>passwordto then
Response.write "<SCRIPT language=JavaScript>alert('两次输入密码不一致!');"
Response.Write "this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if If Trim(Request.Form("validatecode"))=Empty Or Trim(Session("))<>Trim(Request.Form("validatecode")) Then
response.write"<script>alert('对不起,请输入正确的验证码!');history.back();</Script>"
response.end()
end if
'检查帐号是否被注册
exec="select * from imlm_user where username='"&username&"'"
set rsc=server.createobject("adodb.recordset")
rsc.open exec,conn,1,1
if not rsc.eof then '查看要注册的用户是否已经存在
addok=0
else
exec="select * from imlm_user where alipay='"&alipay&"'"
set rsc=server.createobject("adodb.recordset")
rsc.open exec,conn,1,1
if not rsc.eof then
addok=2
else
addok=1
end if '未
end if
rsc.close
set rsc=nothing
if addok=1 then
if id="" then
else
tgj="select * from imlm_user where username='"&id&"'"
set rsd=server.createobject("adodb.recordset")
rsd.open tgj,conn,1,3
if rsd.eof then '推广+jine
else
rsd("jine")=rsd("jine")+5
rsd.update
end if
rsd.close
set rsd=nothing
end if
exec="select * from imlm_user"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,3
rs.addnew
rs("username")=username
rs("password")=md5(password)
rs("name")=name
rs("oicq")=oicq
rs("alipay")=alipay
rs("jine")=20
rs("sx1")=id
rs("sx2")=sx2
rs("sx3")=sx3
rs("sx4")=sx4
rs("sx5")=sx5
rs("yesno")=true
rs.update
rs.close
set rs=nothing
Set rss=Server.CreateObject("ADODB.recordset")
mysq="select * from imlm_setup where id=1"
rss.open mysq,conn,1,3
rss("adgamedi")=adgamedi+1
rss.update
rss.close
set rss=nothing
elseif addok=0 then
Response.write "<SCRIPT language=JavaScript>alert('对不起!用户名已被注册!');"
Response.Write "this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
else
Response.write "<SCRIPT language=JavaScript>alert('对不起!支付宝已被注册!');"
Response.Write "this.location.href='vbscript:history.back()';</SCRIPT>"
Response.End
end if
mm=0
Session("imlmusername")=username
Response.write "<SCRIPT language=JavaScript>alert('恭喜您!注册用户成功!');"
Response.Write "this.location.href='accounts.asp';</SCRIPT>"
Response.End
end if
%>