gusucode.com > 爱美尔女性商城源码 1.0源码程序 > reg.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户注册-<%=webname%></title>
<meta name="keywords" content="<%=keywords%>" />
<meta name="description" content="<%=description1%>" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.idtabs.js"></script>
<script type="text/javascript" src="js/swf.js"></script>
</head>
<body>
<!--#include file="top.asp" -->
<%dim action
action=request.QueryString("action")%>   
<script language=JavaScript>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkuserinfo()
{
   if(checkspace(document.userinfo.username.value)) {
	document.userinfo.username.focus();
    alert("对不起,请填写用户名!");
	return false;
  }
    if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 6 || document.userinfo.userpassword.value.length >20) {
	document.userinfo.userpassword.focus();
    alert("密码长度应该在6位到20位之间,请重新输入!");
	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;
   }
   if(checkspace(document.userinfo.quesion.value)) {
	document.userinfo.quesion.focus();
    alert("对不起,请填写密码提问!");
	return false;
  }
   if(checkspace(document.userinfo.answer.value)) {
	document.userinfo.answer.focus();
    alert("对不起,请填写密码提问的答案!");
	return false;
  }
   if(checkspace(document.userinfo.userzhenshiname.value)) {
	document.userinfo.userzhenshiname.focus();
    alert("对不起,请填写真实姓名!");
	return false;
  }
  if(checkspace(document.userinfo.shouhuodizhi.value)) {
	document.userinfo.shouhuodizhi.focus();
    alert("对不起,请填写收货人详细收货地址!");
	return false;
  }
  if(checkspace(document.userinfo.youbian.value)) {
	document.userinfo.youbian.focus();
    alert("对不起,请填写邮编!");
	return false;
  }
  if(document.userinfo.youbian.value.length!=6) {
	document.userinfo.youbian.focus();
    alert("对不起,请正确填写邮编!");
	return false;
  } 
    if(checkspace(document.userinfo.usertel.value)) {
	document.userinfo.usertel.focus();
    alert("对不起,请填写电话号码!");
	return false;
  } 

}

function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>

<table width="995" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="20"><div align="center"></div></td>
  </tr>
</table>
<table width="995" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="50" valign="top"><h4><br />
        用户注册</h4>
      <div>
        <div>
          <p style="color:#999999;">欢迎来到爱美尔,希望您在这里的停留的每一秒都是愉悦的。(如果您还不是爱美尔的会员,请您填写下面的信息进行注册。)</p>
        </div>
      </div>
      <div></div></td>
  </tr>
  <style>
   .reg th{ font-size:14px; font-weight:normal;}
   .reg th font{ color:#ff0000; font-weight:normal; margin-right:5px;}
  </style>
  <tr>
    <td valign="top" style="border:1px solid #ccc; padding:10px;">
	<%select case action
case ""%>
	<table width="100%" cellpadding="0" cellspacing="0" class="reg">
      <tr>
        <th colspan="2" align="right"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td height="40" align="center"><font color=red><strong>请用户仔细阅读<%=webname%>注册条约</strong></font></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td><table width="98%" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#CCCCCC">
                            <tr bgcolor="#ffffff">
                              <td align="left"><%call tiaoyue()%>                              </td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
					<table name=agree border="0" cellpadding="10" cellspacing="0" align=center width="98%">
                        <tr align=center>
                          <td width="50%" align="right"><FORM name=register method=post action=reg.asp?action=yes>
                              <input type="hidden" name="action" value="agree">
                              <INPUT class="go-wenbenkuang" type=submit value=" 同意注册 " name=Submit>
                          </FORM></td>
                          <td width="50%" align="left"><FORM action=index.asp method=post>
                              <INPUT class=go-wenbenkuang type=submit value=" 我不同意 ">
                          </FORM></td>
                        </tr>
                    </table>
					<%case "yes"%>
					<form name=userinfo method=post action=reg.asp?action=save>

<TABLE cellSpacing=0 cellPadding=0 width="100%">
  <COLGROUP>
  <COL width=30>
  <COL width=118>
  <COL width=204>
  <COL></COLGROUP>
  <THEAD>
  <TR>
    <TH colSpan=4>
      <H3><SPAN class=right><EM class=cRed><font size="4">*</font></EM><font size="4"> 
                        为必填项</font></SPAN><font size="4"> 用户注册</font></H3></TH></TR></THEAD>
  <TBODY>
  <TR>
                    <TD width="1%" class="cRed text-Ct">&nbsp;</TD>
    <TD width="14%" height="25">用户名:</TD>
    <TD width="58%"><INPUT id=username maxLength=50 name=username>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD width="27%"><EM>
      <DIV id=txtNameTip></DIV></EM></TD></TR>
  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">设定密码:</TD>
    <TD><INPUT id=userpassword type=password maxLength=50 name=userpassword>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD><EM>
      <DIV id=txtPasswordTip></DIV></EM></TD></TR>
  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">重复设定密码:</TD>
    <TD><INPUT id=userpassword1 type=password maxLength=50 
name=userpassword1>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD><EM>
      <DIV id=txtPassword2Tip></DIV></EM></TD></TR>
  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">E-mail地址:</TD>
    <TD><INPUT id=useremail maxLength=80 name=useremail>
                      &nbsp; <span><font color="#FF0000">*</font></span><BR>
                      <LABEL 
      for=cbxHideEmail></LABEL></TD>
    <TD><EM>
      <DIV id=txtEmailTip></DIV></EM></TD></TR>
  
  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">找回密码问题:</TD>
    <TD 
    onclick="document.getElementById('txtHandsetTip').innerHTML='请填写手机号';document.getElementById('txtHandsetTip').focus();"><INPUT 
      id=quesion maxLength=100 size=35 name=quesion>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD><EM>
      <DIV id=txtQuestionTip></DIV></EM></TD></TR>
  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">找回密码答案:</TD>
    <TD><INPUT id=answer maxLength=100 size=35 name=answer>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD><EM>
      <DIV id=txtAnswerTip></DIV></EM></TD></TR>
	  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">真实姓名:</TD>
    <TD class=content><INPUT id=userzhenshiname name=userzhenshiname>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD class=tip>
      <DIV id=txtHandsetTip></DIV></TD></TR>
	  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">手机号码:</TD>
    <TD class=content><INPUT id=usertel name=usertel>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD class=tip>
      <DIV id=txtHandsetTip></DIV></TD></TR>
	  <TR>
    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">性  别:</TD>
    <TD class=content><input type=radio name=sex id=sex value=1 checked>
                              男
                                <input type=radio name=sex id=sex value=2>
                                女</TD>
    <TD class=tip>
      <DIV id=txtHandsetTip></DIV></TD></TR>
	  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">收货(通讯)地址:</TD>
    <TD class=content><INPUT name=shouhuodizhi id=shouhuodizhi size="50">
                      <span><font color="#FF0000">*</font></span></TD>
    <TD class=tip>
      <DIV id=txtHandsetTip></DIV></TD></TR>
	  <TR>
                    <TD class="cRed text-Ct">&nbsp;</TD>
    <TD height="25">邮  编:</TD>
    <TD class=content><INPUT id=youbian name=youbian>
                      <span><font color="#FF0000">*</font></span></TD>
    <TD class=tip>
      <DIV id=txtHandsetTip></DIV></TD></TR>
 </TBODY></TABLE>

<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 148px; PADDING-BOTTOM: 20px; PADDING-TOP: 10px">
<input value="注册新用户" type="submit" onClick="return checkuserinfo();"/>
 
</P>


</FORM>
					</th>
        </tr>
      
    </table>
    </td>
  </tr>
</table>

<%case "save"%>
                <!--#include file="md5.asp"-->
                <%call saveuser()%>
                <%
end select%>
                <%sub tiaoyue()
set rs=server.CreateObject("adodb.recordset")
rs.Open "select regtiaoyue from BJX_config",conn,1,1
response.Write trim(rs("regtiaoyue"))
rs.Close
set rs=nothing
end sub

sub saveuser()
if session("regtimes")=1 then
response.Write "<table width=760 border=0 cellspacing=0 cellpadding=0 align=center><tr><td height=300 align=center><font color=red>对不起,您刚注册过用户,请稍后再进行注册!</font></td></tr></table>"
response.End
end if

set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bjx_User where useremail='"&trim(request("useremail"))&"' or username='"&trim(request("username"))&"'",conn,1,1
if rs.recordcount>0 then
call usererr()
rs.close
else
rs.close

set rs=server.CreateObject("adodb.recordset")
rs.open "select * from bjx_User",conn,1,3
rs.addnew
rs("username")=trim(request("username"))
rs("userpassword")=md5(trim(request("userpassword")),16)
rs("useremail")=trim(request("useremail"))
rs("Quesion")=trim(request("Quesion"))
rs("answer")=md5(trim(request("answer")),16)
rs("userzhenshiname")=trim(request("userzhenshiname"))
rs("shouhuodizhi")=trim(request("shouhuodizhi"))
rs("youbian")=trim(request("youbian"))
rs("usertel")=trim(request("usertel"))
'rs("songhuofangshi")=trim(request("songhuofangshi"))
'rs("zhifufangshi")=trim(request("zhifufangshi"))
rs("adddate")=now()
rs("lastlogin")=now()
rs("logins")=1

rs("reglx")=1
rs("jifen")=100
rs("jiaoyijine")=0
rs("sex")=trim(request("sex"))
rs("userlastip")=Request.ServerVariables("REMOTE_ADDR")
'rs("dadyname")=trim(request("dadyname"))
'rs("szShi")=trim(request("szShi"))
'rs("MoMname")=trim(request("MoMname"))
'rs("MoMNo")=trim(request("MoMNo"))
'rs("yuchan")=trim(request("yuchan"))
'rs("babysex")=trim(request("babysex"))

rs.update
rs.close
set rs=nothing
set rs=conn.execute("select top 1 userid,face from bjx_User order by userid desc")
userid=rs(0)
response.Cookies("bjx")("username")=trim(request("username"))
response.Cookies("bjx")("jiaoyijine")=0
response.Cookies("bjx")("jifen")=0
response.Cookies("bjx")("reglx")=1
response.Cookies("shangcheng").expires=date+1
session("regtimes")=1
session.Timeout=1

response.Write "<table width=760 align=center border=0 cellspacing=0 cellpadding=0 class=table-zuoyou bordercolor=#CCCCCC><tr><td bordercolor=#FFFFFF bgcolor=#FFFFFF align=center> "
response.Write "<table width=450 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=260>"
response.Write "<p>· <font color=red>用户注册成功!</font></p><p>· 恭喜您注册成为 ["&webname&"] 的正式用户,请记好您的用户名及密码!</p>"
response.Write "<p>· <a href=index.asp>返回首页</a></p></td></tr></table></td></tr></table>"
end if
end sub

sub usererr()
response.write "<table width=760 align=center border=0 cellspacing=0 cellpadding=0 class=table-zuoyou bordercolor=#CCCCCC><tr><td bordercolor=#FFFFFF bgcolor=#FFFFFF align=center>"
response.write "<table width=450 border=0 align=center cellpadding=2 cellspacing=0><tr><td height=260>"
response.write "<p>· <font color=red>用户注册失败!</font></p><p>· 您输入的用户名或e-mail地址已存在,请返回重新输入!</p><p>· <a href=javascript:history.go(-1)>返回上一页</a></p> </td></tr></table></td></tr></table>"
end sub
%>
<!--#include file="bottom.asp" -->
</body>
</html>