📄 reg.asp
字号:
<!--#include file="inc/CONN.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="inc/style.css"-->
<script language=javascript src="inc/js.inc"></script>
<title>填写注册资料</title>
</head>
<body <%=skin(13)%>>
<%if request("action")="save" then
dim temp(12)
for i=1 to 12
temp(i)=trim(request.form(i))
for j=0 to ubound(split(cfg(11),"|"))
if instr(temp(i),trim(split(cfg(11),"|")(j)))<>0 then errs="不要填写不文明字词或空格、特殊字符\n\n"
next
next
if temp(4)="" or temp(5)="" or temp(6)="" then errs=errs+"带星号的必须填写\n\n"
if len(temp(1))<3 then errs=errs+"用户名长度为3-16位\n\n"
if len(temp(3))<3 then errs=errs+"用户密码长度为3-15位\n\n"
if instr(temp(6),"@")<=1 then
errs=errs+"信箱填写错误:缺@\n\n"
else
aemail=right(temp(6),len(temp(6))-instr(temp(6),"@"))
bemail=right(temp(6),len(temp(6))-instr(temp(6),"."))
if len(aemail)<=1 or instr(aemail,".")=0 or len(bemail)<=1 then errs=errs+"信箱填写错误\n\n"
end if
if Lcase(temp(8))="http://" then temp(8)=""
if temp(8)<>"" and Lcase(left(temp(8),7))<>"http://" then errs=errs+"主页URL必须以http://开头\n\n"
if Lcase(temp(9))="http://" then temp(9)=""
if temp(9)<>"" then
if Lcase(left(temp(9),7))<>"http://" then errs=errs+"BannerURL必须以http://开头\n\n"
if Lcase(right(temp(9),4))<>".jpg" and Lcase(right(temp(9),4))<>".gif" and Lcase(right(temp(9),4))<>".swf" then errs=errs+"Banner的格式只能是jpg/gif/swf\n\n"
if not isnumeric(temp(11)) or not isnumeric(temp(12)) then errs=errs+"Banner大小必须填写数字\n\n"
if int(temp(11))>468 or int(temp(12))>60 then errs=errs+"Banner大小不能超过468*60"
temp(9)=temp(9)&","&temp(11)&","&temp(12)
end if
if errs<>"" then
response.write "<script language=javascript>alert( """&errs&""");"&Chr(13)&"location.href=""javascript:history.back()"";</script>"
response.end
end if
temppwd=temp(3)
temp(3)=md5(temp(3))
tempanswer=temp(5)
temp(5)=md5(temp(5))
set rs=conn.execute("select userid from [user] where username='"&temp(1)&"'")
if not rs.bof then
response.write "<script language=javascript>alert( ""这个名字已经被注册"");"&Chr(13)&"location.href=""javascript:history.back()"";</script>"
response.end
end if
rs.close
set rs=server.createobject("adodb.recordset")
rs.open "select * from [user] where userid is null",conn,1,3
rs.addnew
for i=1 to 10
rs(i)=temp(i)
next
rs(11)=now()
rs(12)=0
rs.update
rs.close
if cfg(7) then
mailbody=mailbody+"注册名:"+temp(1)+"<BR>"
mailbody=mailbody+"密 码:"+temppwd+"<BR>"
mailbody=mailbody+"留言本:<a href=http://"+request("http_host")
mailbody=mailbody+left(request("script_name"),int(len(request("script_name"))-7))
mailbody=mailbody+"index.asp?username="+temp(1)+" target=blank>"
mailbody=mailbody+"http://"+request("http_host")
mailbody=mailbody+left(request("script_name"),int(len(request("script_name"))-7))
mailbody=mailbody+"index.asp?username="+temp(1)
mailbody=mailbody+"</a>"
set objmail = Server.createobject("CDONTS.Newmail")
objmail.to = usermail
objmail.from = Serveremail
objmail.subject = "留言本申请成功"
objmail.mailformat = 0
objmail.bodyformat = 0
objmail.body = mailbody
objmail.send
set objmail = nothing
if err.number<>0 then
tempstr="由于smtp服务出错,未能发送邮件"
err.clear()
else
tempstr="已经将注册信息发往您的信箱"
end if
end if
%>
<BR>
<table align=center border=1 bordercolor=<%=skin(11)%> cellpadding=3 cellspacing=0 width="480">
<Tr class=titlestyle>
<Td colspan=2><B>恭喜您注册成功 !</b></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<td align=center nowrap width=70>注 册 名</td>
<td width=*><%=temp(1)%></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<td align=center nowrap>密 码</td>
<td><%=temppwd%></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<td align=center nowrap>提 示 </td>
<td><%=temp(4)%></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<td align=center nowrap>答 案 </td>
<td><%=tempanswer%></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<td align=center nowrap>主 页 </td>
<td><a href=<%=temp(8)%> target=_blank><%=temp(7)%></a></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<td align=center nowrap>留言本地址</td>
<td><a href=http://<%=request("http_host")%><%=left(request("script_name"),int(len(request("script_name"))-7))%>index.asp?username=<%=temp(1)%> target=_blank> http://<%=request("http_host")%><%=left(request("script_name"),int(len(request("script_name"))-7))%>index.asp?username=<%=temp(1)%></a></td>
</tr>
<tr bgcolor=<%=skin(4)%>>
<td colspan=2 align=center><font color=<%=skin(8)%>><%=tempstr%></font> <a href=javascript:window.close() title=close>关闭窗口</a></td>
</tr>
</table>
<%else%>
<BR>
<table align=center border=1 bordercolor=<%=skin(11)%> cellpadding=3 cellspacing=0 width="480">
<form name=reg action="reg.asp?action=save" method=post onsubmit="submitonce(this)">
<tr align="center" class=titlestyle>
<Td colspan=2><B>填写注册信息</b></td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center width="25%">注册名<BR> </td>
<td width="75%"><input name=UserName type=text maxlength=12 size=25>
* 可以用中文,3-15位。</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>性别<Br> </td>
<td><input name=UserSex type=radio class=noborder value=0 checked>
男
<input name=UserSex type=radio value=1 class=noborder>
女</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>密码<BR> </td>
<td><input name=UserPass type=text maxlength=15 size=25 style="ime-mode:disabled" onpaste="return false">
* 3-15位</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center width="29%">密码提示<BR> </td>
<td width="71%"><input name=Question type=text maxlength=16 size=25>
* 用于找回密码。</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>提示答案<BR> </td>
<td><input name=Answer type=text maxlength=15 size=25>
* 密码提示的答案</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>常用信箱<BR> </td>
<td><input name=Usermail type=text maxlength=36 size=25>
* 用于接受注册资料 </td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>主页名</td>
<td><input name=Userhpgname type=text maxlength=16 size=25>
长度 < 16</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>主页地址</td>
<td><input name=Userhpgurl type=text maxlength=80 size=25 value="http://">
必须以http://开头</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>banner图片</td>
<td><input name=banner type=text maxlength=80 size=25 value="http://">
格式 jpg/gif/swf </td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>留言本风格</td>
<td><select name=skinid id=skinid><option value="<%=cfg(8)%>">默认风格</option>
<%set rs=conn.execute("select skinid,skinname from skin where skinid<>"&cfg(8)&" order by skinid asc")
do until rs.eof
response.write "<option value="&rs(0)&">"&rs(1)&"</option>"
rs.movenext
loop
rs.close
set rs=conn.execute("select top 1 username from [user] order by userid asc")
tempname=rs(0)
rs.close%></select> <input name=view type=button value="预览" onclick="javascript:window.open('index.asp?username=<%=tempname%>&skinid='+skinid.options[skinid.selectedIndex].value)">
</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center>banner大小</td>
<td>宽度<input name=bannerwidth type=text maxlength=3 size=4 style="ime-mode:disabled" onpaste="return false"> 1-468 高度<input name=bannerheight type=text maxlength=2 size=4 style="ime-mode:disabled" onpaste="return false"> 1-60
</td>
</tr>
<tr bgcolor=<%=skin(5)%>>
<Td align=center></td>
<td> </td>
</tr>
<tr bgcolor=<%=skin(4)%>>
<Td colspan=2 align=center><%set rs=conn.execute("select count(*) from [user]")
tempnum=rs(0)
rs.close
if cint(tempnum)<cint(cfg(6)) then
response.write "<INPUT name=submit type=submit value=申请>"
else
response.write "申请数量已达限制<font color="&skin(8)&">"&cfg(6)&"</font>,因此停止注册"
end if%>
<INPUT name="reset" type=reset value="关闭" title=关闭窗口 onclick="javascript:window.close()"></td>
</tr>
</form>
</table>
<%end if%>
<!--#include file="inc/foot.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -