📄 regok.asp
字号:
<!--#include file="top.asp"-->
<!--#include file="md5.asp"-->
<title><%=sitename%>--注册成功</title>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="170" valign="top">
</td>
<td width="7"> </td>
<td>
<%
set rs=server.createobject("adodb.recordset")%>
<%
function check(user_mail)
dim names, c
'Check for valid syntax in an email address.
check = true
names = Split(user_mail, "@")
if UBound(names)<> 1 then
check = false
exit function
end if
for each name in names
if Len(name) <= 0 then
check = false
exit function
end if
for i = 1 to Len(name)
c = Lcase(Mid(name, i, 1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c)then
check = false
exit function
end if
next
if Left(name, 1)= "." or Right(name, 1)= "." then
check = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
check = false
exit function
end if
i = Len(names(1))- InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
check = false
exit function
end if
if InStr(email, "..")> 0 then
check = false
end if
end function
dim user_id, user_mail, user_adds, user_postalcode, user_name, user_grade
dim sex, pass1, pass2, password
if check(trim(request("user_mail")))=false then
errmsg=errmsg+"<br>"+"<li>对不起,你的E-mail有错误"
founderr=true
else
user_mail=trim(request("user_mail"))
end if
if trim(request("user_id"))="" or Len(request("user_id"))>10 or len(request("user_id"))<2 then
errmsg=errmsg+"<br>"+"<li>对不起,用户名不能为空(长度不能大于10小于2)"
founderr=true
else
user_id=trim(request("user_id"))
end if
if trim(request("user_name"))="" then
errmsg=errmsg+"<br>"+"<li>对不起,真实姓名为必填项"
founderr=true
else
user_name=trim(request("user_name"))
end if
if request("ps1")="" or Len(request("ps1"))>16 or len(request("ps1"))<6 then
errmsg=errmsg+"<br>"+"<li>对不起,请输入您的密码(长度不能大于16小于6)。"
founderr=true
else
pass1=request("ps1")
end if
if request("ps2")="" or Len(request("ps2"))>16 or len(request("ps2"))<6 then
errmsg=errmsg+"<br>"+"<li>对不起,请输入确认密码(长度不能大于16小于6)。"
founderr=true
else
pass2=request("ps2")
end if
if pass1<>pass2 then
errmsg=errmsg+"<br>"+"<li>对不起,您输入的密码和确认密码不一致。"
founderr=true
else
password=pass2
end if
if request("user_tel")="" then
errmsg=errmsg+"<Br>"+"<li>对不起,电话号码不能为空,请点击浏览器的后退键重新填写您的电话号码"
founderr=true
else
user_tel=request("user_tel")
end if
if request("user_adds")="" then
errmsg=errmsg+"<Br>"+"<li>对不起,地址不能为空,请点击浏览器的后退键重新填写您的地址"
founderr=true
else
user_adds=request("user_adds")
end if
if request("user_postalcode")="" then
errmsg=errmsg+"<br>"+"<li>对不起,邮编不能为空,请点击浏览器的后退键重新填写您的邮编"
founderr=true
else
user_postalcode=request("user_postalcode")
end if
sql="select * from 56770_user where user_id='"&user_id&"'"
rs.open sql, conn, 3, 3
if not rs.eof then
errmsg=errmsg+"<br>"+"<li>对不起,该帐号已被别人注册,请点击浏览器的后退键重新选择您的登陆帐号"
founderr=true
end if
rs.close
%>
<%if founderr=false then
sql="select top 1 user_id,user_adds, user_mail, user_password, regip, user_postalcode, user_name, sex, user_tel, user_grade, regdate, logins from 56770_user"
rs.open sql, conn, 1, 2
rs.addnew
rs("user_id")=user_id
rs("user_adds")=user_adds
rs("user_mail")=user_mail
rs("user_password")=md5(password)
rs("regip")=request.servervariables("remote_addr")
rs("user_postalcode")=user_postalcode
rs("user_name")=user_name
rs("sex")=request("sex")
rs("user_tel")=user_tel
rs("user_grade")="会员"
rs("regdate")=now()
rs("logins")=1
user_grade=rs("user_grade")
user_tel=rs("user_tel")
rs.update
session("user_id")=rs("user_id")
session("user_grade")=rs("user_grade")
rs.close
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30">注册成功!以下是您的注册信息!</td>
</tr>
</table>
<table class=b1 cellspacing=1 cellpadding=4 width="100%" border=0>
<tbody>
<tr>
<td align=right width=150 bgcolor=#E0E0E0><font
color=#ff6600>*</font><b>E-mail:</b></td>
<td bgcolor=#eff8df><font color="#FF0000"><%=user_mail%></font>
</td>
</tr>
<tr>
<td align=right bgcolor=#E0E0E0><font color=#ff6600>*</font><b>登陆帐号:</b></td>
<td bgcolor=#eff8df><font color="#FF0000"><%=user_id%></font>
</td>
</tr>
<tr>
<td align=right bgcolor=#E0E0E0><font
color=#ff6600>*</font><b>姓名/称呼:</b></td>
<td bgcolor=#eff8df><font color="#FF0000"><%=user_name%></font>
<font color="#FF0000"><%=sex%></font> </td>
</tr>
<tr>
<td align=right bgcolor=#E0E0E0><font
color=#ff6600>*</font><b>帐号密码:<br>
</b></td>
<td bgcolor=#eff8df> <font color="#FF0000"><%=user_password%></font>
→请牢记您的密码</td>
</tr>
<tr>
<td align=right bgcolor=#E0E0E0><font
color=#ff6600>*</font><b>电话号码:</b></td>
<td bgcolor=#eff8df><font color="#FF0000"><%=user_tel%></font>
</td>
</tr>
<tr>
<td align=right bgcolor=#E0E0E0 height="25"><font
color=#ff6600>*</font><b>邮政编码:</b></td>
<td bgcolor=#eff8df height="25"><font color="#FF0000"><%=user_postalcode%></font>
</td>
</tr>
<tr>
<td align=right bgcolor=#E0E0E0><font
color=#ff6600>*</font><b>真实住址:</b></td>
<td bgcolor=#eff8df><font color="#FF0000"><%=user_adds%></font>
</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" height="30"><a href="default.asp">感谢您的注册,返回页面</a></td>
</tr>
</table><%end if%>
<%=errmsg%></td>
</tr>
</table>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -