📄 regsave.asp
字号:
<!--#include file="top.asp"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<center>
<%
function IsValidEmail(user_mail)
dim names, name, i, c
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(user_mail, "@")
if UBound(names) <> 1 then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= 0 then
IsValidEmail = 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
IsValidEmail = false
exit function
end if
next
if Left(name, 1) = "." or Right(name, 1) = "." then
IsValidEmail = false
exit function
end if
next
if InStr(names(1), ".") <= 0 then
IsValidEmail = false
exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
IsValidEmail = false
exit function
end if
if InStr(email, "..") > 0 then
IsValidEmail = false
end if
end function
dim user_name,user_pass,user_pass2,user_mail,user_adds,user_tel,uesr_postcode
if trim(request("user_name"))="" then
errmsg=errmsg+"<br>"+"<li>用户名不能为空"
founderr=true
else
user_name=trim(request("user_name"))
end if
if trim(request("user_pass"))="" or trim(request("user_pass2"))="" then
errmsg=errmsg+"<br>"+"<li>密码或确认不能为空"
founderr=true
else
user_pass=trim(request("user_pass"))
user_pass2=trim(request("user_pass2"))
end if
if user_pass <> user_pass2 then
errmsg=errmsg+"<br>"+"<li>两次密码不同"
founder=true
end if
if request("user_adds")="" then
errmsg=errmsg+"<Br>"+"<li>地址不能为空"
founderr=true
else
user_adds=request("user_adds")
end if
if request("user_tel")="" then
if not IsNumeric(request("user_tel")) then
errmsg=errmsg+"<br>"+"<li>电话号码不能为空"
founderr=true
end if
else
user_tel=request("user_tel")
end if
if isvalidemail(trim(request("user_mail")))=false then
errmsg=errmsg+"<br>"+"<li>你的E-mail有错误"
founderr=true
else
user_mail=trim(request("user_mail"))
end if
if request("user_postcode")="" then
errmsg=errmsg+"<br>"+"<li>邮编不能为空"
founderr=true
else
user_postcode=request("user_postcode")
end if
sql="select * from user where user_name='"&user_name&"'"
rs.open sql,conn,3,3
if not rs.eof then
errmsg=errmsg+"<br>"+"<li>用户名已被别人注册"
founderr=true
end if
rs.close
%>
<table border="0" width="760" cellspacing="0" cellpadding="0" height="312">
<tr>
<td width="190" height="312" valign="top" align="left">
<table border="0" width="190" cellspacing="0" cellpadding="0">
<tr>
<td width="190" valign="top" align="left"><!--#include file="left.asp"--></td>
</tr>
</table>
</td>
</center>
<td width="380" valign="top" align="left">
<table border="0" width="380" cellspacing="0" cellpadding="0" height="5">
<%if founderr=false then
sql="select * from user where user_name='"&user_name&"'"
rs.open sql,conn,3,3
rs.addnew
rs("user_name")=user_name
rs("user_pass")=user_pass
rs("user_adds")=user_adds
rs("user_mail")=user_mail
rs("user_tel")=user_tel
rs("user_regip")=request.servervariables("remote_addr")
rs("user_postcode")=user_postcode
rs("user_namec")=request("user_namec")
rs.update
rs.close
%>
<tr>
<td width="100%" bgcolor="#FF9933" height="18">
<p align="center">注册成功</p>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#63CFFF">
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%" bgcolor="#FFFFFF">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="23%">用户名</td>
<td width="77%"><%=user_name%></td>
</tr>
<tr>
<td width="23%">密码</td>
<td width="77%"><%=user_pass%></td>
</tr>
<tr>
<td width="23%">E-mail</td>
<td width="77%"><%=user_mail%></td>
</tr>
<tr>
<td width="23%">地址</td>
<td width="77%"><%=user_adds%></td>
</tr>
<tr>
<td width="23%">电话</td>
<td width="77%"><%=user_tel%></td>
</tr>
<tr>
<td width="23%">邮编</td>
<td width="77%"><%=user_postcode%></td>
</tr>
<tr>
<td width="100%" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="5"></td>
</tr>
<%else%>
<tr>
<td width="100%" bgcolor="#FF9933" height="18">
<p align="center">注册失败</p>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#63CFFF">
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%" bgcolor="#FFFFFF"><%=errmsg%></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF"> </td>
</tr>
<%end if%>
</table>
</td>
<td width="190" valign="top" align="left">
<table border="0" width="190" cellspacing="0" cellpadding="0">
<tr>
<td width="190"><!--#include file="right.asp"--></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -