📄 reg.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="top.asp"-->
<SCRIPT LANGUAGE="JavaScript">
<!--//
function reset()
{
document.form1.user.value="";
document.form1.realname.value="";
}
//-->
</SCRIPT>
<table width="100%" class="szy" bgcolor=#ffffff>
<tr>
<td align="left" width="100%">  <img src="image/register1.gif" border="0"><br>
<font color=red>注</font>:带!!为必填项</td>
</tr>
</table>
<%if trim(request("mode"))="reg" or trim(request("mode"))="" then %>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class=xzy bgcolor="#ffffff">
<tr>
<td width="130" align="right"><form name="form1" method="post" action="reg.asp?mode=submit" onsubmit="return check()">用户名:</td>
<td width="370">
<input type="text" name="user"> !!(请写英文)
</td>
</tr> <tr>
<td width="130" align="right">真实姓名:<br>
</td>
<td height="15" width="370">
<input type="text" name="realname">
!!(请填写中文)</td>
</tr>
<tr>
<td width="130" align=right>
头像:</td>
<td width="370">
<select name=face size=1 onChange="document.images['face'].src=options[selectedIndex].value;" style="BACKGROUND-COLOR: #99CCFF; BORDER-BOTTOM: 1px double; BORDER-LEFT: 1px double; BORDER-RIGHT: 1px double; BORDER-TOP: 1px double; COLOR: #000000">
<% for i=1 to 137
response.write"<option value='face/"&i&".gif'>头像"&i&"</option>"
next
%>
</select><img id=face src="face/1.gif" alt=个人形象代表>**</td>
</tr>
<input type="hidden" name="email" value="asd@163.com">
<tr>
<td width="130" align="right"> </td>
<td width="370" height="50" valign="bottom">
<input type="image" src="image/1-sub.gif">  
<a href="javascript:reset()"><img border="0" src="image/1-reset.gif" width="44" height="23"></a>   </td>
</tr>
</form>
</table>
<br>
<br>
<br>
<br>
</td>
</tr>
</table>
<%end if%>
<%if request("mode")="submit" then %>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class=xzy bgcolor="#ffffff">
<tr><td align=center><br><br><br><br><br><br><br>
<%if trim(request.form("user"))="" then%>
对不起,<font color=red>用户名为空!</font>
请返回重写
<%elseif trim(request.form("realname"))="" then%>
对不起,<font color=red>真实姓名为空!</font>请返回重写
<%elseif trim(request.form("email"))="" then %>
对不起,<font color=red>email</font>
请返回重写
<%elseif Isemail(trim(request.form("email")))=false then %>
对不起,<font color=red>email格式不对</font>
请返回重写
<%else%>
<% if isemail(trim(request.form("email")))<>false then%>
<%set rs=server.createobject("adodb.recordset")
user=request("user")
sql="select * from user where user='"&user&"'"
rs.open sql,conn,1,3
if not rs.eof and not rs.bof then%>
对不起,您输入的用户名已经被注册,请重新输入
<%
rs.close
set rs=nothing
else
set rs1=server.createobject("adodb.recordset")
sql1="select * from user where realname='"&trim(request("realname"))&"' order by id"
rs1.open sql1,conn,1,3
if rs1.eof or rs1.bof then
%>
对不起,找不到匹配的数据,你的姓名和电子邮件其中一个有误,请返回重写或和刘名伟联系
<%else
email=rs1("email")
'生成随机密码
Dim i, intNum, intUpper, intLower, intRand, strPartPass, genPassword
genPassword = ""
Randomize
For i = 1 to 8
intNum = Int(10 * Rnd + 48)
intUpper = Int(26 * Rnd + 65)
intLower = Int(26 * Rnd + 97)
intRand = Int(3 * Rnd + 1)
Select Case intRand
Case 1
strPartPass = Chr(intNum)
Case 2
strPartPass = Chr(intUpper)
Case 3
strPartPass = Chr(intLower)
End Select
genPassword = genPassword & strPartPass
Next
randomPassword = genPassword
'生成密码结束
'加密密码开始
function encrypt(preString)
Dim texts
Dim seed
Dim i,length
prestring = trim(preString)
length = len(preString)
seed = length
Randomize(length)
texts = ""
for i = 1 to length
seed = int(94*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = texts & chr(seed) & chr(int(94*rnd(-seed)+32))
next
dim dist
dist=""
for i = 1 to len(texts)
if mid(texts,i,1)<>"'" then
dist=dist+mid(texts,i,1)
end if
next
encrypt = dist
end function
'加密结束
password=encrypt(randompassword)
conn.execute"update user set user='"&trim(request("user"))&"',password='"&password&"',userimage='"&face&"' where realname='"&trim(request("realname"))&"'"
conn.close
set conn=nothing
%>
恭喜,<%=request("user")%>,你已经注册成功!
<%
username=request("user")
topic="您在"&sysName&"注册的个人资料"
mailbody="<html><head><title></title></head>"
mailbody=mailbody &"<style>A:visited { TEXT-DECORATION: none }"
mailbody=mailbody &"A:active { TEXT-DECORATION: none }"
mailbody=mailbody &"A:hover { TEXT-DECORATION: underline overline }"
mailbody=mailbody &"A:link { text-decoration: none;}"
mailbody=mailbody &"A:visited { text-decoration: none;}"
mailbody=mailbody &"A:active { TEXT-DECORATION: none;}"
mailbody=mailbody &"A:hover { TEXT-DECORATION: underline overline}"
mailbody=mailbody &"BODY { FONT-FAMILY: 宋体; FONT-SIZE: 9pt;}"
mailbody=mailbody &"TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }</style>"
mailbody=mailbody &"</head><body><TABLE border=0 width='95%' align=center><TBODY><TR><TD>"
mailbody=mailbody &""&trim(request("user"))&",您好:<br><br>"
mailbody=mailbody &"欢迎您注册本系统,我们将提供给您最好的服务!<br>"
mailbody=mailbody &"下面是您的注册信息:<br>"
mailbody=mailbody &"注册名:"&trim(request("user"))&"<br>"
mailbody=mailbody &"登陆密码:"&randompassword&"<br>"
mailbody=mailbody &"加密后的密码:"&password&"<br>你不用担心你的密码被别人获得,就是管理员也无法得知你的真实密码!"
mailbody=mailbody &"<br><br>"
mailbody=mailbody &"<center><font color=red>再次感谢您注册本系统,让我们一起来建设这个网上家园!</font>"
mailbody=mailbody &"<br><br><br>"
mailbody=mailbody &"<tr align=right><td><font size=3.5pt> "&now()&"</font></td></tr>"
mailbody=mailbody &"<br><br><br><br><br>"
mailbody=mailbody &"***********************************************************************************************"
mailbody=mailbody &"</TD></TR></TBODY></TABLE></body></html>"
%>
<!--#include file="email.asp"-->
<%if EmailFlag=0 then%><center>欢迎使用本系统,有任何问题,请与网管人心(<%=systememail%>)(QQ:5241279)联系!
<%elseif EmailFlag=1 then
Response.Write "<center> 一封注册信已经发送到你您注册时填写的信箱"&email
call Jmail()
%>
<%elseif EmailFlag=2 then
Response.Write "<center> 一封注册信已经发送到你您注册时填写的信箱!"
call Cdonts()
%>
<%elseif EmailFlag=3 then
Response.Write "<center> 一封注册信已经发送到你您注册时填写的信箱"
call Aspemail()
end if
%><br><br>请返回  <a href="index.asp">主页</a>  登陆
<%
end if
end if%>
<%end if%><br><br><br><br><br>
</td></tr></table>
<%end if%>
<%end if%>
<!--#include file="end.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -