📄 reg2.asp
字号:
<!-- #Include File=../sys/inc/char.asp -->
<!-- #Include File=../sys/email.asp -->
<!-- #Include File=top.asp -->
<!-- #Include File=../sys/inc/prompt.inc -->
<%
dim username
dim sex
dim password
dim password2
dim pass1
dim pass2
dim address
dim useremail
dim face
dim oicq
dim mail
dim homeurl
dim ispublic
dim rs,sql
dim founderr
dim errmsg
dim rlword
dim mailbody,sendmsg
founderr=false
call conned()
call chkinput ()
if founderr=true then
call error()
else
call saveuserinfo()
if founderr=true then
call error()
else
topic="会员注册成功"
call sendmail()
call reginfo()
end if
end if
'-------------------------------------------------
sub chkinput()
'-------------------------------------------regtime
if not isnull(request.cookies("soonhost")("regtime")) or cint(regtime)>0 then
if DateDiff("s",request.cookies("soonhost")("regtime"),Now())<cint(RegTime) then
ErrMsg=ErrMsg+"<Br>"+"<li>本论坛限制每次注册距离时间为"®time&"秒,请稍后注册。"
FoundErr=True
end if
end if
'--------------------------------------------chkpost
if chkpost=false then
ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
FoundErr=True
end if
'---------------------------------------------username
if request("username")="" or strLength(request("username"))>15 then
errmsg=errmsg+"<br>"+"<li>请输入您的用户名(长度不能大于15)!"
founderr=true
else
username=trim(request("username"))
end if
if Instr(request("username"),"=")>0 or Instr(request("username"),"%")>0 or Instr(request("username"),chr(32))>0 or Instr(request("username"),"?")>0 or Instr(request("username"),"&")>0 or Instr(request("username"),";")>0 or Instr(request("username"),",")>0 or Instr(request("username"),"'")>0 or Instr(request("username"),",")>0 or Instr(request("username"),chr(34))>0 or Instr(request("username"),"+") >0 then
errmsg=errmsg+"<br>"+"<li>您的用户名中含有非法字符!"
founderr=true
else
username=trim(request("username"))
end if
'--------------------------------------password
if request("password")="" or strLength(request("password"))>12 then
errmsg=errmsg+"<br>"+"<li>请输入您的密码(长度不能大于12)!"
founderr=true
else
pass1=request("password")
end if
if request("password2")="" or strLength(request("password2"))>12 then
errmsg=errmsg+"<br>"+"<li>请输入确认密码(长度不能大于12)!"
founderr=true
else
pass2=request("password2")
end if
if pass1<>pass2 then
errmsg=errmsg+"<br>"+"<li>您输入的密码和确认密码不一致!"
founderr=true
else
password=pass2
end if
'-------------------------------------------name
if request("rlword")="" or strLength(request("rlword"))>15 then
errmsg=errmsg+"<br>"+"<li>请输入您的真实姓名(长度不能大于15)!"
founderr=true
else
rlword=trim(request("rlword"))
end if
if Instr(request("rlword"),"=")>0 or Instr(request("rlword"),"%")>0 or Instr(request("rlword"),chr(32))>0 or Instr(request("rlword"),"?")>0 or Instr(request("rlword"),"&")>0 or Instr(request("rlword"),";")>0 or Instr(request("rlword"),",")>0 or Instr(request("rlword"),"'")>0 or Instr(request("rlword"),",")>0 or Instr(request("rlword"),chr(34))>0 or Instr(request("rlword"),"+") >0 then
errmsg=errmsg+"<br>"+"<li>您的用户名中含有非法字符!"
founderr=true
else
rlword=trim(request("rlword"))
end if
'Response.Write (rlword)
'----------------------------------address
if request("address")="" or strLength(request("address"))>40 then
errmsg=errmsg+"<br>"+"<li>请选择您的地址(长度不能大于40)!"
founderr=true
else
address=trim(request("address"))
end if
if Instr(request("address"),"=")>0 or Instr(request("address"),"%")>0 or Instr(request("name"),chr(32))>0 or Instr(request("name"),"?")>0 or Instr(request("name"),"&")>0 or Instr(request("name"),";")>0 or Instr(request("name"),",")>0 or Instr(request("name"),"'")>0 or Instr(request("name"),",")>0 or Instr(request("name"),chr(34))>0 or Instr(request("name"),"+") >0 then
errmsg=errmsg+"<br>"+"<li>您的地址中含有非法字符!"
founderr=true
else
address=trim(request("address"))
end if
'-----------------------------------------sex
if request("sex")=0 or request("sex")=1 then
sex=request("sex")
else
sex=1
end if
'-----------------------------------------------mail
if IsValidEmail(trim(request("e_mail")))=false then
errmsg=errmsg+"<br>"+"<li>您的Email有错误!"
founderr=true
else
useremail=trim(request("e_mail"))
end if
'-----------------------------------------------face
face=request("myface")
if request("myface")="" then
errmsg=errmsg+"<br>"+"<li>请选择您的个性头像!"
founderr=true
else
face=request("myface")
end if
'response.write (face)
'-------------------------------------------oicq
if request("oicq")<>"" then
if not isnumeric(request("oicq")) or len(request("oicq"))>10 then
errmsg=errmsg+"<br>"+"<li>Oicq号码只能是4-10位数字,您可以选择不输入!。"
founderr=true
else oicq=request("oicq")
end if
end if
'---------------------------------------------homeurl
if strLength(request("homeurl"))>40 then
errmsg=errmsg+"<br>"+"<li>网址(长度不能大于40)!"
founderr=true
else homeurl=htmlencode(request("homeurl"))
end if
'------------------------------ispublic
if request("ispublic")=1 then
ispublic=request("ispublic")
else
ispublic=0
end if
end sub
sub saveuserinfo()
set rs=server.createobject("adodb.recordset")
sql="select * from [userinfo] where busername='"&username&"'"
rs.open sql,conn,1,3
if not rs.eof or not rs.bof then
errmsg=errmsg+"<br>"+"<li>对不起,您输入的用户名已经被注册。"
founderr=true
else
rs.addnew
rs("busername")=username
rs("bpassword")=password
rs("brlword")=rlword
rs("baddress")=address
rs("bface")=face
rs("boicq")=oicq
Rs("bsex")=sex
Rs("bmail")=useremail
if request("homeurl")<>"" then
Rs("burl")=homeurl
else
Rs("burl")="http://"
end if
Rs("bpublic")=ispublic
if tempmember=1 then
rs("bclass")=0
else
rs("bclass")=1
end if
Rs("btime")=now
rs.update
rs.close
set rs=nothing
response.cookies("soonhost")("regtime")=now()
end if
end sub
sub sendmail()
dim err
err=false
on error resume next
mailbody=mailbody &"尊敬的:"&username&"您好!"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &" 您已经成功的注册成为"&homename&"的会员。"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"您的用户名是:"&username& vbcrlf
mailbody=mailbody &"密 码:"&(password)& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"再次感谢您注册本系统!"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"会员服务由 "&homename&"提供("&homepage&")"&vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"--------------------------------------------"& vbcrlf
mailbody=mailbody &"程序制做:迅捷网络(http://www.soonhost.com)"& vbcrlf
mailbody=mailbody &"迅捷网络--域名注册,主机租用,网站建设,脚本开发"& vbcrlf
mailbody=mailbody &"--------------------------------------------"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &" "&now& vbcrlf
mailbody=mailbody &""
select case EmailFlag
case 0
sendmsg="系统未开启邮件功能,请记住您的注册信息。"
case 1
call jmail(useremail)
case 2
call Cdonts(useremail)
case else
sendmsg="系统未开启邮件功能,请记住您的注册信息"
end select
if SendMailed <> "OK" then
sendmsg="由于系统错误,未能成功发送邮件。"
else
if EmailFlag=o then
sendmsg="系统未开启邮件功能,请记住您的注册信息。"
else
sendmsg="您的注册信息已经发往您的邮箱,请注意查收。"
end if
end if
end sub
'--------------------------------------reginfo()
sub reginfo()
call top()
%>
<br><br><br>
<table border=1 cellpadding=4 cellspacing=0
width="500" align="center" bordercolor=<%=coborder%>>
<tr>
<td class=td align=middle colspan="2" height="32">
<p align="center"><b>新用户注册成功</b> </p>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>用户名称:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%=request("username")%> </div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>您的密码:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%=request("password")%> </div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>真实姓名:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%=rlword%></div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>地区:</td>
<td class=td2 align=middle>
<div align="left"> <%=address%></div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>头象:</td>
<td class=td2 align=middle>
<div align="left"> <img src="<%=face%>"></div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>Oicq:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%if request("oicq")="" then%> 未注册 <%else%> <%=request("oicq")%>
<%end if%> </div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>您的性别:</td>
<td class=td2 align=middle
width=483>
<div align="left"><%if sex=1 then%>男 <%else%> 女 <%end if%></div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>邮箱地址:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%=useremail%></div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>主页地址:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%=homeurl%> </div>
</td>
</tr>
<tr>
<td class=td1 align=middle
width=483>信息公开:</td>
<td class=td2 align=middle
width=483>
<div align="left"> <%if ispublic=1 then response.write"其它网友可以看到我的信息" else response.write"其它网友不能看到我的信息"%>
</div>
</td>
</tr>
<tr>
<td class=td align=middle colspan="2">
<div align="center"> <a href=index.asp>请登陆</a> </div>
</td>
</tr>
<tr>
<td class=td align=middle colspan="2"><%=sendmsg%></td>
</tr>
<tbody> </tbody>
</table>
<!-- #Include file="../foot.inc" -->
<%
end sub
'================================================
'程序制做:迅捷网络. http://www.soonhost.com
'迅捷主机网 -- 域名注册、主机租用、网站建设、脚本开发
'网址:http://www.soonhost.com
'msn:soonhost@hotmail.com
'请保留以上版权信息,谢谢合作!
'================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -