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

📄 regsave.asp

📁 ASP+ACCESS 产品报价系统 开发环境简单 主要是周杰伦FANs的交互活动
💻 ASP
字号:
<!--#include file="top.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<%dim rs,sql
          set rs=server.createobject("adodb.recordset")
         
          %>

<%
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 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
%>
<link href="img/style.css" rel="stylesheet" type="text/css">
<div align="center">
  <center>
    <table width="337" height="5" border="0" cellpadding="0" cellspacing="1" bordercolor="#111111" bgcolor="#CCCCCC" style="border-collapse: collapse">
      <%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="#fff2d5"><font color="#990000"><strong>注册成功</strong></font></td>
            
          </tr>
          <tr> 
            <td bgcolor="#ECECEC"> <table border="0" width="100%" cellspacing="1">
                <tr> 
                  
              <td width="100%" bgcolor="f7f7f7" ><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"><font color="#990000">用户名:</font></div></td>
                        <td width="67%" height="25"><div align="center"><%=user_name%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right"><font color="#990000">密码:</font></div></td>
                        <td width="67%" height="25"><div align="center"><%=user_pass%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right"><font color="#990000">E-mail:</font></div></td>
                        <td width="67%" height="25"><div align="center"><%=user_mail%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right"><font color="#990000">地址:</font></div></td>
                        <td width="67%" height="25"><div align="center"><%=user_adds%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right"><font color="#990000">电话:</font></div></td>
                        <td width="67%" height="25"><div align="center"><%=user_tel%></div></td>
                      </tr>
                      <tr> 
                        <td width="33%" height="25"><div align="right"><font color="#990000">邮编:</font></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">进入主页</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"></div></td>
                      </tr>
                    </table></td>
                </tr>
              </table></td>
          </tr>

          <%else%>
          <tr> 
            
        <td width="100%" height="25" align="center" bgcolor="#fff2d5"><font color="#990000"><strong>注册失败</strong></font></td> 
          </tr>
          <tr> 
            <td bgcolor="#ECECEC"> <table border="0" width="100%" cellspacing="1">
                <tr> 
                  
              <td width="100%" bgcolor="f7f7f7"><%=errmsg%> <a href="javascript:history.go(-1)"><font color="#FF6600">请返回重新注册</font></a></td>
                </tr>
              </table></td>
          </tr>
          <%end if%>
        </table>

  </center>
</div>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -