reg.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:8k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <%
  6. if NOT isempty(request("RegSubmit")) then 
  7. if session("regtimes")=1 then
  8. call MsgBox("对不起,您刚注册过用户!","Back","None")
  9. response.end
  10. end if
  11. set rs=server.CreateObject("adodb.recordset")
  12. rs.open "select username,useremail from [user] where username='"&trim(request("username"))&"' or useremail='"&trim(request("useremail"))&"'",conn,1,1
  13. if not rs.eof and not rs.bof then
  14. call MsgBox("您输入的用户名或Email地址已存在,请返回重新输入!","Back","None")
  15. end if
  16. rs.close
  17. rs.open "select * from [user]",conn,1,3
  18. rs.addnew
  19. rs("username")=trim(request("username"))
  20. rs("password")=md5(trim(request("password")))
  21. rs("useremail")=trim(request("useremail"))
  22. rs("quesion")=trim(request("quesion"))
  23. rs("answer")=md5(trim(request("answer")))
  24. rs("realname")=trim(request("realname"))
  25. '身份证
  26. rs("identify")=trim(request("identify"))
  27. rs("mobile")=trim(request("mobile"))
  28. rs("userqq")=trim(request("userqq"))
  29. rs("adddate")=now()
  30. rs("lastvst")=now()
  31. rs("loginnum")=0
  32. rs("postcode")=0
  33. rs("score")=0
  34. rs("paymethord")=0
  35. rs("deliverymethord")=0
  36. rs.update
  37. rs.close
  38. set rs=nothing
  39. response.Cookies(cookieName)("username")=trim(request("username"))
  40. response.Cookies(cookieName).expires=date+1
  41. session("regtimes")=1
  42. session.Timeout=1
  43. call MsgBox("注册成功!请到用户管理中心填详细资料!","GoUrl","muser.asp")
  44. end if
  45. %>
  46. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  47. <html>
  48. <head>
  49. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  50. <title>406网络书店</title>
  51. <link href="style.css" rel="stylesheet" type="text/css">
  52. <style type="text/css">
  53. <!--
  54. .style2 {color: #000000}
  55. -->
  56. </style>
  57. </head>
  58. <body>
  59. <!--#include file="head.htm"-->
  60. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  61.   <tr>
  62.     <td align="left" valign="top"> <br>      <br>      <table cellpadding="0" cellspacing="0" border="0">
  63.         <tr>
  64.           <td width="18"><img src="images/w.gif"></td>
  65.           <td style="color:#415373">用户注册</td>
  66.         </tr>
  67.         </table>      <br>      <br>      <FORM NAME="userinfo" METHOD="post" ACTION="" >
  68.         <TABLE BORDER="0" ALIGN="center" CELLPADDING="2" CELLSPACING="1" >
  69.           <tr>
  70.             <TD colspan="2" ALIGN="center"><FONT COLOR="#cb6f00">请填写用户信息</FONT></TD>
  71.           </tr>
  72.           
  73.             <TR>
  74.               <TD align="right"><FONT COLOR="#cb6f00">*用户名:</FONT></TD>
  75.               <TD><INPUT NAME="username" TYPE="text" ID="username2" >
  76.         用户名长度不能小于2。</TD>
  77.             </TR>
  78.             <TR>
  79.               <TD><div align="right"><FONT COLOR="#cb6f00">*密码:</FONT></div></TD>
  80.               <TD>
  81.                 <INPUT NAME="password" TYPE="password" ID="password">
  82.         长度必须大于6个字符。</TD>
  83.             </TR>
  84.             <TR>
  85.               <TD><div align="right"><FONT COLOR="#cb6f00">*确认密码:</FONT> </div></TD>
  86.               <TD>
  87.                 <INPUT NAME="password1" TYPE="password" ID="password1">
  88.               </TD>
  89.             </TR>
  90.             <TR>
  91.               <TD><div align="right"><FONT COLOR="#cb6f00">*E-Mail:</FONT> </div></TD>
  92.               <TD>
  93.                 <INPUT NAME="useremail" TYPE="text" ID="useremail2">
  94.         请您务必填写正确的E-mail地址,便于我们与您联系;</TD>
  95.             </TR>
  96.             <TR>
  97.               <TD><div align="right"><FONT COLOR="#cb6f00">真实姓名: </FONT></div></TD>
  98.               <TD>
  99.                 <INPUT NAME="realname" TYPE="text" ID="realname2">
  100.         收货人姓名。</TD>
  101.             </TR>
  102.             <TR>
  103.               <TD><div align="right"><FONT COLOR="#cb6f00">身份证号码: </FONT></div></TD>
  104.               <TD>
  105.                 <input name="identify" type="text" id="userqq3" onKeyPress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))" 
  106. onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
  107. ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))">
  108.               此项信息用于必要时以核实身份,一经注册,便不可更改,请如实填写!</TD>
  109.             </TR>
  110.             <TR>
  111.               <TD><div align="right"><FONT COLOR="#cb6f00">移动手机: </FONT></div></TD>
  112.               <TD>
  113.                 <input name="mobile" type="text" id="userqq4" onKeyPress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))" 
  114. onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
  115. ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))">
  116.               请填写正确的号码,以便有急事联系。</TD>
  117.             </TR>
  118.             <TR>
  119.               <TD><div align="right"><FONT COLOR="#cb6f00"> Q Q:</FONT> </div></TD>
  120.               <TD>
  121.         <input name="userqq" type="text" id="userqq" onKeyPress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))" 
  122. onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
  123. ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))">
  124.         网上联系        </TD>
  125.             </TR>
  126.             <TR>
  127.               <TD><div align="right"><FONT COLOR=#cb6f00>密码提示: </FONT></div></TD>
  128.               <TD>
  129.                 <INPUT NAME="quesion" TYPE="text" ID="quesion2">
  130.               </TD>
  131.             </TR>
  132.             <TR>
  133.               <TD><div align="right"><FONT COLOR=#cb6f00>密码答案: </FONT></div></TD>
  134.               <TD>
  135.                 <INPUT NAME="answer" TYPE="text" ID="answer2">
  136.               </TD>
  137.             </TR>
  138.             <TR>
  139.               <TD colspan="2" align="center">
  140.                 <INPUT  TYPE="submit" ONCLICK="return check();" NAME="RegSubmit" STYLE="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee"VALUE="提交" >
  141.                 <input type="reset" name="Submit5" STYLE="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee" value="清除">
  142.                 <script language="JavaScript">
  143. <!--
  144. function check()
  145. {
  146.    if(checkspace(document.userinfo.username.value)) {
  147. document.userinfo.username.focus();
  148.     alert("用户名不能为空,请重新输入!");
  149. return false;
  150.   }
  151.     if(checkspace(document.userinfo.username.value) || document.userinfo.username.value.length < 2) {
  152. document.userinfo.username.focus();
  153.     alert("用户名长度不能小于2,请重新输入!");
  154. return false;
  155.   }
  156.     if(checkspace(document.userinfo.identify.value) || document.userinfo.identify.value.length < 15) {
  157. document.userinfo.identify.focus();
  158.     alert("身份证号码长度不能小于15位,请重新输入!");
  159. return false;
  160.   }
  161.     if(checkspace(document.userinfo.password.value) || document.userinfo.password.value.length < 6) {
  162. document.userinfo.password.focus();
  163.     alert("密码长度不能小于6,请重新输入!");
  164. return false;
  165.   }
  166.     if(document.userinfo.password.value != document.userinfo.password1.value) {
  167. document.userinfo.password.focus();
  168. document.userinfo.password.value = '';
  169. document.userinfo.password1.value = '';
  170.     alert("两次输入的密码不同,请重新输入!");
  171. return false;
  172.   }
  173.  if(document.userinfo.useremail.value.length!=0)
  174.   {
  175.     if (document.userinfo.useremail.value.charAt(0)=="." ||        
  176.          document.userinfo.useremail.value.charAt(0)=="@"||       
  177.          document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
  178.          document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
  179.          document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
  180.          document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
  181.      {
  182.       alert("Email地址格式不正确!");
  183.       document.userinfo.useremail.focus();
  184.       return false;
  185.       }
  186.    }
  187.  else
  188.   {
  189.    alert("Email不能为空!");
  190.    document.userinfo.useremail.focus();
  191.    return false;
  192.    }
  193. }
  194. function checkspace(checkstr) {
  195.   var str = '';
  196.   for(i = 0; i < checkstr.length; i++) {
  197.     str = str + ' ';
  198.   }
  199.   return (str == checkstr);
  200. }
  201. //-->
  202.                 </script> <br>
  203.               <br>
  204.               <br></TD>
  205.             </TR>
  206.           
  207.         </TABLE>
  208.       </FORM></td>
  209.   </tr>
  210. </table>
  211. <!--#include file="foot.htm"-->
  212. </body>
  213. </html>