📄 regsave.asp
字号:
<!--#include file="top.asp"-->
<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
if request("user_namec")="" then
errmsg=errmsg+"<br>"+"<li>姓名不能为空"
founderr=true
else
user_postcode=request("user_postcode")
end if
strTemp=user_name
If Instr(strTemp,"select%20") or Instr(strTemp,"insert%20") or Instr(strTemp,"delete%20from") or Instr(strTemp,"count(") or Instr(strTemp,"drop%20table") or Instr(strTemp,"update%20") or Instr(strTemp,"truncate%20") or Instr(strTemp,"asc(") or Instr(strTemp,"mid(") or Instr(strTemp,"char(") or Instr(strTemp,"xp_cmdshell") or Instr(strTemp,"exec%20master") or Instr(strTemp,"net%20localgroup%20administrators") or Instr(strTemp,":") or Instr(strTemp,"net%20user") or Instr(strTemp,"'") or Instr(strTemp,"%20or%20") then
%> <script language=vbs>
<!--
msgbox"大哥,您输入有误,还是再输一次吧!!"
window.location.href="index.asp"
-->
</script>
<%response.end
End If
user_name=replace(strTemp,"'","''")
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 bgcolor="ffffff" border="0" width="780" cellspacing="0" cellpadding="0" height="312">
<tr>
<td width="150" valign="top" align="center" bgcolor=f7f7f7>
<table border="0" width="150" cellspacing="0" cellpadding="0">
<tr>
<td width="150" valign="top" align="center"><!--#include file="left.asp"--></td>
</tr>
</table>
</td>
</center>
<td width="100%" valign="top" align="center">
<table border="0" width="100%" 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%" height="18">
<p align="center"><font color="#FF0000" size="3"><b><br>
注册成功 <a href="INDEX.ASP">返回首页</a></b></font></p>
<p align="center"> </p>
</td>
</tr>
<tr>
<td width="100%" >
<table border="0" width="100%" cellspacing="1" height="181">
<tr>
<td width="100%" bgcolor="#FFFFFF">
<div align="center">
<table border="1" width="95%" cellspacing="0" cellpadding="0" height="180" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
<tr>
<td width="23%" align="center" height="29" style="padding: 5px">用户名:</td>
<td width="77%" height="29" style="padding: 5px"><%=user_name%></td>
</tr>
<tr>
<td width="23%" align="center" height="30" style="padding: 5px">密码:</td>
<td width="77%" height="30" style="padding: 5px"><%=user_pass%></td>
</tr>
<tr>
<td width="23%" align="center" height="30" style="padding: 5px">E-mail:</td>
<td width="77%" height="30" style="padding: 5px"><%=user_mail%></td>
</tr>
<tr>
<td width="23%" align="center" height="30" style="padding: 5px">地址:</td>
<td width="77%" height="30" style="padding: 5px"><%=user_adds%></td>
</tr>
<tr>
<td width="23%" align="center" height="30" style="padding: 5px">电话:</td>
<td width="77%" height="30" style="padding: 5px"><%=user_tel%></td>
</tr>
<tr>
<td width="23%" align="center" height="30" style="padding: 5px">邮编:</td>
<td width="77%" height="30" style="padding: 5px"><%=user_postcode%></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center" height="1"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="5"></td>
</tr>
<%else%>
<tr>
<td width="100%" height="18">
<p align="center"><font color="#FF0000" size="4"><b>注册失败</b></font></p>
</td>
</tr>
<tr>
<td width="100%" bgcolor="<%sql="select * from sys"
rs.open sql,conn,3,3%>
<%=rs("sys_color")%>
<%rs.close%>">
<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>
</tr>
</table>
<!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -