📄 reg.asp
字号:
<!--#include file="up.asp"-->
<%if bbsinfo(14)="2" then
call sendinfo("","<li>本论坛目前暂停注册!</li><li>如有问题请联系论坛管理员</li><li><a href='index.asp'>进入论坛首页。</a></li>")
call down
closedb
response.end
end if
set rs=conn.execute("select sms from config")
sms=rs("sms")
dim action,sms
action=request.querystring("action")
select case action
case "agree"
Call ShowReg()
case "save"%>
<!--#include file="inc/regfun.asp"-->
<!--#include file="inc/md5.asp"-->
<%Call SaveReg()
case else
Call ShowRegTxt()
end select
call down
%>
<%Sub ShowRegTxt%>
<table align="center" class="BBS_BoardList" cellpadding="0" cellspacing="1">
<tr class="BBS_BoardTitle">
<td> <img src="pic/gl.gif" border="0" /> 用户注册条款和声明</td>
</tr>
<tr class="BBS_BoardItem">
<td>
<b>继续注册前请先阅读论坛协议</b><br /> 欢迎您加入本站点参加交流和讨论,本站点为公共论坛,为维护网上公共秩序和社会稳定,请您自觉遵守以下条款:<br /><br />
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播下列信息:<br />
(一)煽动抗拒、破坏宪法和法律、行政法规实施的;<br />
(二)煽动颠覆国家政权,推翻社会主义制度的;<br />
(三)煽动分裂国家、破坏国家统一的;<br />
(四)煽动民族仇恨、民族歧视,破坏民族团结的;<br />
(五)捏造或者歪曲事实,散布谣言,扰乱社会秩序的;<br />
(六)宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的;<br />
(七)公然侮辱他人或者捏造事实诽谤他人的,或者进行其他恶意攻击的;<br />
(八)损害国家机关信誉的;<br />
(九)其他违反宪法和法律行政法规的;<br />
(十)进行商业广告行为的。<br /><br />
二、互相尊重,对自己的言论和行为负责。
</td>
</tr>
<form method="post" action="reg.asp?action=agree">
<tr align="center">
<td><h2><input type="submit" value=" 我 同 意 " /></h2></td>
</tr>
</form>
</table>
<%End Sub%>
<%Sub ShowReg()%>
<script language="JavaScript">
<!--
function openwin() {
document.form1.name.value=document.form.name.value;
document.form1.email.value=document.form.email.value;
var popupWin = window.open('', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes');
document.form1.submit()
}
//-->
</script>
<form name="form1" action="paper.asp?action=checkreg" method="post" target="showgg">
<input type="hidden" name="name" value="">
<input type="hidden" name="email" value="">
</form>
<form method="post" action="reg.asp?action=save" name="form">
<%=ttop%>
<table align="center" class="BBS_BoardList" cellpadding="0" cellspacing="1">
<tr class="BBS_BoardTitle">
<td colspan="2"> <img src="pic/gl.gif" border="0" /> 用户注册资料</td>
</tr>
<tr>
<td colspan="2"><h2>必填资料:</h2></td>
</tr>
<tr class="BBS_BoardItem">
<td width="45%"><b>用户名</b>:<br />注册用户名不能超过10个字符(5个汉字)。</td>
<td> <input type="text" name="name" size="30" maxlength="16" /> <input type="button" value=" 检测用户名 " onclick="openwin()" name="B1" /></td>
</tr>
<tr class="BBS_BoardItem">
<td><b>性别</b>:<br />请选择您的性别</td>
<td> <input type="radio" name="sex" value="1" checked /> <img src="pic/boy.gif" align="absmiddle" /> 帅哥 <input type="radio" name="sex" value="2" /> <img src="pic/girl.gif" align="absmiddle" /> 靓女</td>
</tr>
<tr class="BBS_BoardItem">
<td><b>密码(最多16位)</b>:<br />请不要使用任何类似 '*'、' ' 或 HTML 字符。</td>
<td> <input type="password" name="password" size="30" maxlength="20" /></td>
</tr>
<tr class="BBS_BoardItem">
<td><b>重复密码(最多16位)</b>:<br />请再输一遍确认。</td>
<td> <input type="password" name="repassword" size="30" maxlength="20" /></td>
</tr>
<tr class="BBS_BoardItem">
<td><b>提示问题</b>:<br />请输入提示问题,如:我的手机号码?</td>
<td> <input type="text" name="question" size="30" maxlength="30" /></td>
</tr>
<tr class="BBS_BoardItem">
<td><b>问题答案</b>:<br />请输入问题答案,如:13888888888</td>
<td> <input type="text" name="answer" size="30" maxlength="30" /></td>
</tr>
<tr class="BBS_BoardItem">
<td><b>Email地址</b>:<br />请输入有效的邮件地址,这将使您能用到论坛中的所有功能。</td>
<td> <input type="text" name="email" size="30" maxlength="100" /></td>
</tr>
<%set rs=conn.execute("select postcode from config")
if rs("postcode")=0 then%>
<tr class="BBS_BoardItem">
<td><b>注册验证码</b>:<br />如无法显示或看不清,请刷新本页。</td>
<td> <input type="text" class="submit" name="adminid" size="6"> 请输入:<img src="inc/code.asp" border="0" align="absmiddle" /></td>
</tr>
<% end if%>
<tr>
<td colspan="2"><h2>选填资料:</h2></td>
<tr>
<tr class="BBS_BoardItem">
<td><b>生日:</b>(请按照2000-01-01格式填写)</td>
<td> <input type="text" name="burn1" size="4" maxlength="4" /> 年 <input type="text" name="burn2" size="2" maxlength="2" /> 月 <input type="text" name="burn3" size="2" maxlength="2" /> 日</td>
</tr>
<tr class="BBS_BoardItem">
<td><b>主页:</b><br />填写你的个人主页,让大家见识见识。</td>
<td> <input type="text" name="home" size="30" maxlength="255" /></td>
</tr>
<tr class="BBS_BoardItem">
<td><b>QQ号码</b>:<br />填写您的QQ地址,方便与他人的联系。</td>
<td> <input type="text" name="qq" size="16" maxlength="9" /> <input type="checkbox" value="1" name="qqshow" /> 使用QQ秀显示我的头像。</td>
</tr>
<tr class="BBS_BoardItem">
<td><b>我的头像:</b><br />使用论坛自带的图像或者自定义图像。<br />如果是自定义图像,请输入完整Url地址。</td>
<td>
<img src="headpic/1.gif" name="tus" align="right" />
编 号:<select name="bbspic" size="1" onChange="showimage()"><%for i=1 to checknum(application(prefix&"picnum"))%><option value="<%=i%>"><%=i%></option><%next%></select> [ <a target="_blank" href="help.asp?action=allheadpic">查看所有头像</a> ]
<br />
自定义:<input name="mypic" size="25" maxlength="100" />
<br />
宽 度:<input type="text" name="picw" size="4" value="<%=checknum(application(prefix&"picw"))%>" /> (最大<%=checknum(application(prefix&"picw"))%>)
<br />
高 度:<input type="text" name="pich" size="4" value="<%=checknum(application(prefix&"pich"))%>" /> (最大<%=checknum(application(prefix&"pich"))%>)
<script language="JavaScript">
<!--
function showimage() {
document.images.tus.src = "headpic/" + document.form.bbspic.options[document.form.bbspic.selectedIndex].value + ".gif";
}
//-->
</script>
</td>
</tr>
<tr class="BBS_BoardItem">
<td><b>个性签名</b>:<br />最多255个字符<br />文字将出现在您发表的文章的结尾处。体现您的个性。</td>
<td> <textarea name="gxqm" rows="5" wrap="physical" cols="60"></textarea></td>
</tr>
<tr>
<td align="center" colspan="2"><h2><input type="submit" value="我填好了,现在注册!" name="Submit"> <input type="reset" value="不行,还是重写吧!" name="Reset"></h2></td>
</tr>
</table>
<%=tbottom%>
</form>
<%End Sub%>
<%Sub SaveReg()
dim name,password,repassword,email,sex,burn1,burn2,burn3,burn,home,qq,gxqm,picw,pich,bbspic,mypic,toupic,qqshow
dim canreg,badwords,z,adminid,sickpass,userinfo,regtime,sql,userid,newuserinfo,bad,b,question,answer
name=Replace(Request.Form("name"),"'","''")
question=Replace(Request.Form("question"),"'","''")
answer=Replace(Request.Form("answer"),"'","''")
password=Replace(Request.Form("password"),"'","''")
repassword=Replace(Request.Form("repassword")," ","")
email=Replace(Request.Form("email"),"'","''")
adminid=Replace(Request.Form("adminid"),"'","''")
sex=checknum(request.form("sex"))
burn1=replace(Request.Form("burn1"),"'","")
burn2=replace(Request.Form("burn2"),"'","")
burn3=replace(Request.Form("burn3"),"'","")
home=Replace(Request.Form("home"),"'","''")
home=ubbg(home)
qq=Replace(Request.Form("qq"),"'","''")
qqshow=Replace(Request.Form("qqshow"),"'","''")
gxqm=Request.Form("gxqm")
gxqm=Replace(left(gxqm,255),"'","''")
gxqm=replace(gxqm,"|","│")
gxqm=checkbad(gxqm)
picw=Replace(Request.Form("picw"),"'","''")
pich=Replace(Request.Form("pich"),"'","''")
mypic=Replace(Request.Form("mypic"),"'","''")
mypic=ubbg(mypic)
bbspic=Replace(Request.Form("bbspic"),"'","''")
canreg=true
if name="" or password="" or repassword="" or email="" or sex="" then
canreg=false
mes="<li>请填写完整必填的资料。</li>"
else
mes=""
if strlength(name)>10 then
canreg=false
mes="<li>你的用户名长度超过了10。</li>"
end if
if not pass_name(name) then
canreg=false
mes=mes&"<li>你的用户名含有非法字符。</li>"
end if
badwords=split(application(prefix&"badwords"),"|")
for z=0 to ubound(badwords)
if instr(name,badwords(z))>0 then
canreg=false
mes=mes&"<li>你的用户名含有论坛禁止使用的字词。</li>"
exit for
end if
next
if canreg=true then
if not conn.execute("select top 1 userid from [user] where name='"&name&"'").eof then canreg=false:mes=mes&"<li>该用户名已经被注册了。</li>"
end if
if len(password)>16 then canreg=false : mes=mes&"<li>你填写的密码长度超过了16。</li>"
if passc(password)=false then canreg=false:mes=mes&"<li>你的密码含有非法字符。</li>"
sickpass=split("123$$1234$$12345$$123456$$1234567$$12345678$$aaa$$111","$$")
for i=0 to ubound(sickpass)
if len(password)<3 or password=sickpass(i) then
canreg=false
mes=mes&"<li>你的密码属于弱口令,请更换密码。</li>"
exit for
end if
next
if repassword<>password then canreg=false : mes=mes&"<li>你两次输入的密码不一样。</li>"
email=server.HTMLEncode(email)
if not IsValidEmail(email) then canreg=false : mes=mes&"<li>你的E-mail填写错误。</li>"
if conn.execute("select postcode from config")(0)=0 then
if Session("adminid")<>request.form("adminid") then canreg=false:mes=mes&"<li>你输入的验证码错误。</li>"
end if
end if
burn=burn1&"-"&burn2&"-"&burn3
if not isdate(burn) then burn="--"
if qq<>"" and (not isnumeric(qq) or (len(qq)<5 or len(qq)>12)) then canreg=false:mes=mes&"<li>你的 QQ 号码填写错误。</li>"
if mypic="" then
toupic="headpic/"&bbspic&".gif|"&checknum(application(prefix&"autopicw"))&"|"&checknum(application(prefix&"autopich"))
else
if picw<>"" and checknum(picw)<=checknum(application(prefix&"picw")) and pich<>"" and checknum(pich)<=checknum(application(prefix&"pich")) then
toupic=mypic&"|"&picw&"|"&pich
else
canreg=false
mes=mes&"<li>你的头像大小设置错误。</li>"
end if
end if
if checknum(application(prefix&"headpicset"))<>1 and instr(toupic,"://")>0 then
canreg=false
mes=mes&"<li>本论坛不允许使用外部头像。</li>"
end if
if canreg=false then
tl=""
mes="<b>对不起!你不能成功地注册用户,可能存在以下问题。</b>"&mes&"<li><a href='javascript:history.go(-1)'><img border=""0"" src=""pic/re.gif"" align=""absmiddle"" /> 返回重新填写。</a></li>"
else
tl=1
mes="恭喜你!<b>"&kbbs(name)&"</b> 注册成功。<br /><li><a href=""login.asp""><img border=""0"" src=""pic/re.gif"" align=""absmiddle""> <font color=""red"">登陆并进入论坛</font></a></li>"
regtime=FormatDateTime(now+timeset/24,2)
userinfo=email&"|"&home&"|"&burn&"|"&qq&"|"&sex&"|"&toupic&"|"&gxqm&"|"®time&"||"&qqshow
password=md5(password)
set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 1 userid,name,password,userinfo,lasttime,question,answer from [user]"
rs.open sql,conn,0,2
rs.addnew
rs("name")=name
rs("password")=password
rs("userinfo")=userinfo
rs("lasttime")=regtime
rs("question")=question
rs("answer")=answer
rs.update
userid=rs("userid")
rs.close
set rs=nothing
newuserinfo=userid&"|"&name
conn.execute("update [config] set newuser='"&newuserinfo&"',usernum=usernum+1")
session("adminid")="1234"%>
<form name="login" action="login.asp?action=login" method="POST">
<input type="hidden" name="lgname" value="<%=name%>">
<input type="hidden" name="lgpwd" value="<%=repassword%>">
<input type="hidden" name="adminid" value="1234">
<input type="hidden" name="cook" value="0">
<input type="hidden" value="1" name="lgtype">
</form>
<script language="JavaScript">
<!--
document.login.submit()
//-->
</script>
<% end if
call sendinfo(tl,mes)
if checknum(bbsinfo(24))=0 then
lguserid=2
dim touserid
touserid=userid
dim content
content=""&kbbs(sms)&""
dim content2
content2=content&"|"&now()+timeset/24
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&touserid&",'"&content2&"')")
end if
End Sub%>
<%function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function
function checkbad(str)
if isnull(str) then exit function
dim bad,b
bad=split(application(prefix&"badcontent"), "|")
for b=0 to ubound(bad)
str=Replace(str,bad(b),string(len(bad(b)),"*"))
next
checkbad=str
end function%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -