标题:求助 这段代码 怎么限制注册用户名 不让使用特殊符号来注册
取消只看楼主
sdliang567
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-8-9
结帖率:0
已结贴  问题点数:10 回复次数:2 
求助 这段代码 怎么限制注册用户名 不让使用特殊符号来注册
<%
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
%>

搜索更多相关主题的帖子: password 注册 特殊符号 用户名 
2012-08-09 01:00
sdliang567
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-8-9
得分:0 
总体来说也就是 只让字母或者字母加数字组合  其他的什么/ *之类的  不让注册
2012-08-09 10:01
sdliang567
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-8-9
得分:0 
回复 3楼 netlin
能说的详细点吗 我吧懂代码的  谢谢了
2012-08-09 14:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-374958-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.095305 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved