⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regsave.asp

📁 网络购物
💻 ASP
字号:
<%'=========================================''         凡人网络购物系统V4.0免费版'    FreeDown.Net info@freedown.net '            www.freedown.net'     版权所有·免费版仅供研究测试只用'            商业使用请购买正版''=========================================%>
<!--#include file="top.asp"-->
<!-- #include file="MD5.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<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>用户名不能为空"
    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=md5(request("user_pass"))
    user_pass2=md5(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 member 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
%>
<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 member 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("user_type")="会员"
            rs.update
            rs.close
            %>
          <tr> 
            <td height="25" align="center" bgcolor="#DBC2B0">注册成功</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">用户名:</div></td>
                        <td width="67%" height="25"><div align="center"><%=user_name%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right">密码:</div></td>
                        <td width="67%" height="25"><div align="center">******</div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right">E-mail:</div></td>
                        <td width="67%" height="25"><div align="center"><%=user_mail%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right">地址:</div></td>
                        <td width="67%" height="25"><div align="center"><%=user_adds%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right">电话:</div></td>
                        <td width="67%" height="25"><div align="center"><%=user_tel%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right">邮编:</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">请返回首页登陆,3秒后自动返回</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/pics/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">注册失败</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 + -