📄 userregpost.asp
字号:
<%PageName="UserRegPost"%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%
function IsValidEmail(email)
'Check for valid syntax in an email address.
IsValidEmail = true
names = Split(email, "@")
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
sub error()
%>
<div align="center">
<center>
<table cellpadding=0 cellspacing=0 border=0 width=750 height="1" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td height="5" width="705" colspan="3" background="images/line_bg01.gif">
<img border="0" src="images/line_bg01.gif"></td>
</tr>
<tr>
<td height="87" width="5" background="images/line_bg02.gif">
<div align="center">
<center>
<p> </p>
</center>
</div>
</td>
<td height="87" width="691">
<table cellpadding=3 cellspacing=0 border=0 width="100%" bgcolor="<%=Tablebackcolor%>" style="border-collapse: collapse" bordercolor="#111111">
<tr align="center">
<td width="100%">错误信息:</td>
</tr>
<tr>
<td width="100%"><b>产生错误的可能原因:<br><%=errmsg%></td>
</tr>
<tr align="center">
<td width="100%"><a href="javascript:history.go(-1)"> << 返回上一页</a></td>
</tr>
</table>
</td>
<td height="87" width="5" background="images/line_bg02.gif">
</td>
</tr>
<tr>
<td height="5" width="750" colspan="3" background="images/line_bg01.gif">
<img border="0" src="images/line_bg01.gif"></td>
</tr>
</table>
</center>
</div>
<%
end sub
founderr=false
if request("UserName")="" or len(request("UserName"))>20 then
errmsg=errmsg+"<br>"+"<li>用户名输入错误(未输入或长度超过了20个字节)。"
founderr=true
else
UserName=trim(request("UserName"))
end if
if request("sex")="" then
errmsg=errmsg+"<br>"+"<li>请选择您的性别。"
founderr=true
elseif request("sex")=0 or request("sex")=1 then
sex=request("sex")
else
errmsg=errmsg+"<br>"+"<li>您输入的字符非法。"
founderr=true
end if
if request("password")="" or Len(request("password"))>10 then
errmsg=errmsg+"<br>"+"<li>请输入您的密码(长度不能大于10)。"
founderr=true
else
password=request("password")
end if
if password<>request("password2") then
errmsg=errmsg+"<br>"+"<li>您输入的密码和确认密码不一致。"
founderr=true
end if
if IsValidEmail(trim(request("Email")))=false then
errmsg=errmsg+"<br>"+"<li>您的Email有错误。"
founderr=true
else
Email=trim(request("Email"))
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"),chr(9))>0 or Instr(request("UserName"),"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -