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

📄 reg.asp

📁 创建和运行动态、交互的Web服务器应用程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="webtop.asp"-->
<html>
<head>
<title><%=webname%>--新用户注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
.pad {
	PADDING-LEFT: 150px
}
</style>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦!:)';return true">

<table width="10" height="7" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height=7></td>
  </tr>
</table>
<%
dim action
    action=request.QueryString("action")
select case action
case ""
%>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D0E2FD">
  <tr> 
    <td height="78" valign="top" bgcolor="#FFFFFF"><br> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="18" bgcolor="#EFF5FE"><div align="center"><b><font size=2><%=webname%>注册条约</font></b></div></td>
        </tr>
        <tr> 
          <td bgcolor="#EFF5FE"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td> 
                <%
                  //显示注册条约
                  set rs=server.CreateObject("adodb.recordset")
                      rs.Open "select regtiaoyue from shop_config",conn,1,1
                      response.Write trim(rs("regtiaoyue"))
                      rs.Close
                  set rs=nothing
                 %></td>
              </tr>
            </table></td>
        </tr>
      </table>
      
        <div align="center">
          <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr><form name="form1" method="post" action="reg.asp?action=yes">
              <td height="36"><div align="center">
                  <input type="submit" name="Submit" value="我 同 意">
                  &nbsp;&nbsp; 
                  <input type="button" name="Submit2" value="我 不 同 意" onClick="#">
                </div></td></form>
            </tr>
          </table>
          
        </div>
      </td>
  </tr>
</table>
<%case "yes"%>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="1" >
  <tr>
    <td align="center"><font color="#0000cc" size=2><b>请认真填写这份用户信息</b></font> 
     <tr><td>
      <table width="60%" border="0" align="center" cellpadding="0" cellspacing="1" >
        <form name="userinfo" method="post" action="reg.asp?action=save" >
          <tr> 
            <td bgcolor="#EFF5FE"><font color=blue>&nbsp;&nbsp;&nbsp;&nbsp;E-Mail&nbsp;&nbsp; 
              :</font>&nbsp;<input name="useremail" type="text" id="useremail">
              请填写您有效的邮件地址。</td>
          </tr>
          <tr> 
            <td bgcolor="#EFF5FE"><font color=blue>&nbsp;&nbsp;&nbsp;&nbsp;用 户 名:</font> 
              <input name="username" type="text" id="username"> 
              长度不能小于4且使用英文字母。</td>
          </tr>
          <tr>
            <td bgcolor="#EFF5FE"><font color=blue>&nbsp;&nbsp;&nbsp;&nbsp;真实姓名: 
              <input name="userzhenshiname" type="text" id="userzhenshiname">
              </font>用于发图书。</td>
          </tr>
          <tr> 
            <td bgcolor="#EFF5FE"><font color=blue>&nbsp;&nbsp;&nbsp;&nbsp;密&nbsp;&nbsp;&nbsp; 
              &nbsp;&nbsp;码: 
              <input name="userpassword" type="password" id="userpassword" size=21>
              </font>长度大于6小于50,且是英语字、数字。<font color=blue>&nbsp; 
              </font></td>
          </tr>
          <tr> 
            <td bgcolor="#EFF5FE"><font color=blue>&nbsp;&nbsp;&nbsp;&nbsp;确认密码: 
              <input name="userpassword1" type="password" id="userpassword1" size=21>
              </font>请再次输入一次密码。<font color=blue>&nbsp; </font></td>
          </tr>
          <tr> 
            <td bgcolor="#EFF5FE"><FONT color=blue>&nbsp;&nbsp;&nbsp;&nbsp;密码提问: 
              <input name="quesion" type="text" id="quesion">
              </FONT>(用于密码遗忘时使用)<FONT color=#cb6f00>&nbsp; </FONT></td>
          </tr>
          <tr> 
            <td bgcolor="#EFF5FE"><FONT color=blue>&nbsp;&nbsp;&nbsp;&nbsp;密码答案: 
              <input name="answer" type="text" id="answer">
              </FONT>(密码遗忘时将验证此答案) </td>
          </tr>
          <tr> 
            <td bgcolor="#EFF5FE" class=pad align="right"><input onClick="return check();" type="submit" name="Submit3" value="提交资料" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          </tr>
        </form>
      </table>
     
  </tr>
</table>
<%
 case "save"
   if session("regtimes")=1 then
      response.Write "<script language=javascript>alert('您刚注册过用户,请稍后再进行注册!');window.location.reload('reg.asp?action=yes')</script>"
      response.End
   end if
   set rs=server.CreateObject("adodb.recordset")
       rs.open "select username,useremail from shop_user where username='"&trim(request("username"))&"' or useremail='"&trim(request("useremail"))&"'",conn,1,1
       if not rs.eof and not rs.bof then
          response.write "<script language=javascript>alert('该用户名或邮箱重复,请重新输入!');window.location.reload('reg.asp?action=yes')</script>"
          response.End
          rs.close
       else
          rs.close
          rs.open "select * from shop_user",conn,1,3
          rs.addnew
          rs("username")=trim(request("username"))
          rs("userpassword")=trim(request("userpassword1"))
          rs("useremail")=trim(request("useremail"))
          rs("quesion")=trim(request("quesion"))
          rs("answer")=trim(request("answer"))
          rs("userzhenshiname")=trim(request("userzhenshiname"))
          rs("shengshi")=1
          rs("city")=1
          rs("adddate")=now()
          rs("lastlogin")=now()
          rs("logins")=0
          rs("youbian")=100000
          rs("zhifufangshi")=0
          rs("shousex")=0
          rs("songid")=0
          rs("blnedit")=0
          rs.update
          rs.close
      set rs=nothing

   response.Cookies("bookshop")("username")=trim(request("username"))
   response.Cookies("bookshop").expires=date+1
   session("regtimes")=1
   session.Timeout=1
   response.Write "<table width=776 border=0 align=center cellpadding=0 cellspacing=1 bgcolor=#D0E2FD><tr><td height=100 bgcolor=#FFFFFF>"
   response.Write "<table width=90% border=0 align=center cellpadding=0 cellspacing=0><tr><td height=80 bgcolor=#EFF5FE class=pad><font color=#cb6f00>用户注册成功</font><br>"
   response.Write "恭喜"&request.Cookies("bookshop")("username")&",您已注册成为《"&webname&"》正式用户,请进行下一步操作:<br>"
   response.Write "·<a href=myuser.asp?action=shouhuoxx>填写收货人详细资料</a><br>·<a href=index.asp>返回书店首页</a></td></tr></table></td></tr></table>"
 end if
end select
%>
<!--#include file="service.asp"-->
<!--#include file="copyright.asp"-->
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
   if(checkspace(document.userinfo.username.value)) {
	document.userinfo.username.focus();
    alert("用户名不能为空,请重新输入!");
	return false;
  }
    if(checkspace(document.userinfo.username.value) || document.userinfo.username.value.length < 4) {
	document.userinfo.username.focus();
    alert("用户名长度不能小于4,请重新输入!");
	return false;
  }
    if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6) {
	document.userinfo.userpassword.focus();
    alert("密码长度不能小于6,请重新输入!");
	return false;
  }
    if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
	document.userinfo.userpassword.focus();
	document.userinfo.userpassword.value = '';
	document.userinfo.userpassword1.value = '';
    alert("两次输入的密码不同,请重新输入!");
	return false;
  }

 if(document.userinfo.useremail.value.length!=0)
  {
    if (document.userinfo.useremail.value.charAt(0)=="." ||        
         document.userinfo.useremail.value.charAt(0)=="@"||       
         document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
         document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
         document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
         document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
     {
      alert("Email地址格式不正确!");
      document.userinfo.useremail.focus();
      return false;
      }
   }
 else
  {
   alert("Email不能为空!");
   document.userinfo.useremail.focus();
   return false;
   }
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>

⌨️ 快捷键说明

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