📄 regsave.asp
字号:
<!--#include file="top.asp"-->
<!-- #include file="MD5.asp" -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<meta http-equiv="refresh" content="3;url=index.asp">
<%
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>Invalid Username entered. Please try again."
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>Invalid Password entered. Please try again."
founderr=true
else
user_pass=md5(request("user_pass"))
user_pass2=md5(request("user_pass2"))
end if
if user_pass <> user_pass2 then
errmsg=errmsg+"<br>"+"<li>Invalid Password entered. Please try again."
founder=true
end if
if request("user_adds")="" then
errmsg=errmsg+"<Br>"+"<li>Invalid Address entered. Please try again."
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>Invalid Phone number entered. Please try again."
founderr=true
end if
else
user_tel=request("user_tel")
end if
if isvalidemail(trim(request("user_mail")))=false then
errmsg=errmsg+"<br>"+"<li>Invalid Email entered. Please try again."
founderr=true
else
user_mail=trim(request("user_mail"))
end if
if request("user_postcode")="" then
errmsg=errmsg+"<br>"+"<li>Invalid Zipcode entered. Please try again."
founderr=true
else
user_postcode=request("user_postcode")
end if
sql="select * from [user] where username='"&user_name&"'"
rs.open sql,conn,3,3
if not rs.eof then
errmsg=errmsg+"<br>"+"<li>Username already existed"
founderr=true
end if
rs.close
%>
<div align="center">
<center>
<table border="0" width="500" cellspacing="0" cellpadding="0" height="5" style="border-collapse: collapse" bordercolor="#111111">
<%if founderr=false then
sql="select * from [user] where username='"&user_name&"'"
rs.open sql,conn,3,3
rs.addnew
rs("username")=user_name
rs("userpass")=user_pass
rs("user_adds")=user_adds
rs("usermail")=user_mail
rs("usertel")=user_tel
rs("user_regip")=request.servervariables("remote_addr")
rs("user_postcode")=user_postcode
rs("user_namec")=request("user_namec")
rs("user_type")="member"
rs("landtime")=now()
rs("user_lastip")=request.servervariables("remote_addr")
rs.update
rs.close
session("user_name")=user_name
session("user_type")="member"
Response.Cookies("username")=user_name
Response.Cookies("userpass")=user_pass
%>
<tr>
<td height="25" align="center" bgcolor="#DBC2B0">Registration complete!</td>
</tr>
<tr>
<td bgcolor="#F5EFE7"> <table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%" ><br>
<div align="center">
<center>
<table width="90%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="33%" height="25"><div align="right">Username:</div></td>
<td width="67%" height="25"><div align="center"><%=user_name%></div></td>
</tr>
<tr>
<td width="33%" height="25"><div align="right">Password:</div></td>
<td width="67%" height="25"><div align="center">******</div></td>
</tr>
<tr>
<td width="33%" height="25"><div align="right">Email:</div></td>
<td width="67%" height="25"><div align="center"><%=user_mail%></div></td>
</tr>
<tr>
<td width="33%" height="25"><div align="right">Address:</div></td>
<td width="67%" height="25"><div align="center"><%=user_adds%></div></td>
</tr>
<tr>
<td width="33%" height="25"><div align="right">Phone
number:</div></td>
<td width="67%" height="25"><div align="center"><%=user_tel%></div></td>
</tr>
<tr>
<td width="33%" height="25"><div align="right">Zipcode:</div></td>
<td width="67%" height="25"><div align="center"><%=user_postcode%></div></td>
</tr>
<tr>
<td height="25" colspan="2"> <div align="center"><a href="index.asp">Redirect to Homepage now.</a></div></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</center>
</div>
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle"><div align="center"><img src="img/seperator.gif" width="359" height="1"></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<%else%>
<tr>
<td width="100%" height="25" align="center" bgcolor="#DBC2B0">Sorry.</td>
</tr>
<tr>
<td bgcolor="#F5EFE7"> <table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%"><%=errmsg%></td>
</tr>
</table></td>
</tr>
<%end if%>
</table>
</center>
</div>
<!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -