<!--#include file="../Include/Conno.asp" -->
<!--#include file="../Include/Char.asp" -->
<!--#include file="../Include/const.asp" -->
<!--#include file="../Images/member/reg.gif"-->
<!--#include file="../Include/md5.asp"-->
<!--#include file="../MailList/Email.asp" -->
<!--#include file="../MailList/MailListConst.asp" -->
<%
If Request.ServerVariables("REQUEST_METHOD")="POST" then
 dim rs,m_Sql
 m_Integral = 100
 m_UserName = Trim(Request.Form("txtUserName"))
 m_Password = checkStr(Trim(Request.Form("txtPassword")))
 m_Email = checkStr(Trim(Request.Form("txtEmail")))

 m_Question = checkStr(Trim(Request.Form("txtQuestion")))
 m_Answer = checkStr(Trim(Request.Form("txtAnswer")))
 m_RegTime = Now()
 m_IPInfo = Request.ServerVariables("REMOTE_ADDR")

 
 if m_IsCardMember = 1 then 
    m_Grade = 1
 else
    m_Grade = 0
 end if   

 m_Sql = "Select * From T_Member where F_UserName='" & m_UserName & "'"
 Set rs = conn.Execute(m_Sql)
 If Not rs.Eof then
     Response.Write "<script>alert('对不起，该用户名已存在，请更换用户名后再试！');history.back();</Script>"
	 Response.End()
 End if
 m_Sql = "Insert Into T_Member(F_UserName,F_Password,F_Email,F_Question,F_Answer,F_RegTime,F_IPInfo,F_Grade,F_Integral,F_IsCheck,F_LoginCount,F_LastLoginTime)"
 m_Sql = m_Sql + " Values('"&m_UserName&"','"&md5(m_Password,16)&"','"&m_Email&"','"&m_Question&"','"&m_Answer&"','"&m_RegTime&"','"&m_IPInfo&"','"&m_Grade&"',"&m_Integral&",1,1,'"&now()&"')"
 conn.execute(m_Sql) 

 m_Sql = "Select F_ID FROM T_Member Where F_UserName='" & m_UserName &"'"
 Set rs = conn.Execute(m_Sql)
 m_ID = rs(0)
 
 'folder="../Member/Photo/"&m_ID
 'Set fso = Server.CreateObject("Scripting.FileSystemObject")
 'if (fso.FolderExists(Server.MapPath(folder))) then
 'else
 'fso.CreateFolder(Server.MapPath(folder))
 'end if

 Response.Cookies("aspxnet")("CurUserID") = m_ID
 Response.Cookies("aspxnet")("CurUserName") = m_UserName
 Response.Cookies("aspxnet")("curgrade") = m_Grade
 Session("CurUserID") = m_ID
 Session("CurUserName") = m_UserName
 Session("curgrade") = m_Grade

 Response.Redirect "Register2.asp?action=read&SendOK="&m_SendOk
 rs.Close
end if 
%>
<html>
<head>
<title>- 会员注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/member.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../Include/JChar.js"></script>
<script language="JavaScript">
  function CheckValidForm()
  {

    var msg="";
	if (document.thisForm.txtUserName.value=="") 
	{
		msg="对不起，用户名不能为空，且不能超过30个字符!";
		alert(msg);
	 	document.thisForm.txtUserName.focus();
	return false;
	}

	if (!IsValidString(document.thisForm.txtPassword.value))
	{
		msg="对不起，密码必须为4个以上的数字或字母！\n并且不能使用汉字当作密码！";
		alert(msg);
	 	document.thisForm.txtPassword.focus();
	return false;
	}

	if (document.thisForm.txtPassword.value!=document.thisForm.txtConfirmPassword.value)
	{
		msg="对不起，密码与确认密码不一致！";
		alert(msg);
		document.thisForm.txtPassword.focus();
	return false;
	}
	if (document.thisForm.txtPassword.value==document.thisForm.txtUserName.value)
	{
		msg="对不起，用户名和密码不能相同！";
		alert(msg);
	 	document.thisForm.txtPassword.focus();
	return false;
	}
	if (!isEmail(document.thisForm.txtEmail.value))
	{
		msg="对不起,您输入的电子邮件可能不正确！\n如果，您使用的是我们系统无法识别的电子邮件地址，请和我们联系！";
		alert(msg);
	 	document.thisForm.txtEmail.focus();
	return false;
	}


  
  }
</script>
</head>
<body topmargin="0" leftmargin="0" >
<!--#include file="../include/top.asp" -->
<!--#include file="../include/member_top.asp" --><!--#include file="club_top.asp" -->
<!--#include file="Top.asp" -->
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="10" bgcolor="#FFFFFF"><img src="../images/member/member_01.gif" width=780 height=27></td>
  </tr>
  <tr> 
    <td height="10" background="../images/member/member_10.gif" bgcolor="#FFFFFF"><table width="780" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="41"><img src="../Images/member/member_02.gif" width="41" height="60"></td>
          <td width="157" background="../images/member/member_04.gif">&nbsp;</td>
          <td width="354" align="right" valign="bottom"><table width="230"  border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="50" align="right"><img src="../Images/member/member_lx1.gif" width="50" height="32"></td>
                <td width="40"><img src="../Images/member/member_l1.gif" width="40" height="32"></td>
                <td width="30"><img src="../Images/member/member_lx.gif" width="30" height="32"></td>
                <td width="40"><img src="../Images/member/member_l2_b.gif" width="40" height="32"></td>
                <td width="30"><img src="../images/member/member_lx.gif" width="30" height="32"></td>
                <td width="40"><img src="../images/member/member_l3.gif" width="40" height="32"></td>
              </tr>
            </table></td>
          <td width="193"><img src="../Images/member/member_05.gif" width="193" height="60"></td>
          <td width="35"><img src="../Images/member/member_06.gif" width="35" height="60"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td background="../images/member/member_10.gif" bgcolor="#FFFFFF"><img src="../Images/member/member_07.gif" width="780" height="45"></td>
  </tr>
  <tr> 
    <td background="../images/member/member_10.gif" bgcolor="#FFFFFF"><table width="780" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="552" align="center" class="p3"> 注：请确认您所填写资料的真实性,我们会在完成注册后发送一封确认信与您。 
            <br>
          </td>
          <td width="228"><img src="../Images/member/member_09.gif" width="228" height="39"></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td align="center" background="../images/member/member_10.gif" bgcolor="#FFFFFF">
	<FORM method=post name=thisForm action="Register.asp"  onSubmit="return CheckValidForm()">
        <br>
        <TABLE width=90% border=0 align="center" cellPadding=6 cellSpacing=0 borderColor=#111111 
      style="BORDER-COLLAPSE: collapse">
          <TBODY>

            <TR> 
              <TD width=16% height=13 align=right bgcolor="f2f2f2"><font 
            color=#b00000>*</font>用 户 名：</TD>
              <TD height=13 align=left bgcolor="f2f2f2"><input class=fieldalp 
            maxlength=20 name=txtUserName size=16> <font 
            color=#624b35>(可以为中文，但不能超过30个字符，不区分大小写。)</font></TD>
            </TR>
            <TR> 
              <TD width=16% height=25 align=right> <FONT 
            color=#b00000>*</FONT>密　　码：</TD>
              <TD width=84% height=25 align=left><INPUT 
            class=fieldalp maxLength=20 name=txtPassword size=16 type=password>
                <FONT color=#FF6600>(密码至少4位，不要与用户名相同，更不能使用银行卡取款密码。) </FONT></TD>
            </TR>
            <TR> 
              <TD width=16% height=0 align=right bgcolor="f2f2f2"><FONT 
          color=#b00000>*</FONT>密码确认：</TD>
              <TD width=84% height=12 align=left bgcolor="f2f2f2"><INPUT class=fieldalp 
            maxLength=20 name=txtConfirmPassword size=16 type=password> <FONT 
            color=#624b35>(请再次输入密码。) </FONT></TD>
            </TR>
            <TR> 
              <TD width=16% height=0 align=right><FONT 
          color=#b00000>*</FONT><font color="#999999">密码问题：</font></TD>
              <TD height=13 align=left><INPUT class=fieldalp 
            maxLength=20 name=txtQuestion size=24 type=text> <font color="#999999">忘记密码的提示问题</font></TD>
            </TR>
            <TR> 
              <TD width=16% height=25 align=right bgcolor="f2f2f2"><FONT 
          color=#b00000>*</FONT><font color="#999999">问题答案：</font></TD>
              <TD height=25 align=left bgcolor="f2f2f2"><INPUT class=fieldalp 
            maxLength=20 name=txtAnswer size=24 type=text> <font color="#999999">忘记密码的提示问题答案，用于取回会员密码</font></TD>
            </TR>
            <TR> 
              <TD width=16% height=12 align=right><FONT 
          color=#b00000>*</FONT>电子邮件：</TD>
              <TD width=84% height=12 align=left><INPUT 
            class=fieldalp maxLength=60 name=txtEmail size=24> <FONT 
            color=#624b35>(请准确填写您的<FONT face=Verdana 
            style="FONT-SIZE: 11px">E-MAIL</FONT>地址。注册后您将收到一封邮件确认信。) </FONT></TD>
            </TR>
            <TR align="center"  valign="bottom"> 
              <TD height=56 colSpan=2> <input name=Step2  style="FONT-FAMILY: 宋体; FONT-SIZE: 12px; HEIGHT: 30px" type=submit value=" 保存并进入下一步"> 
              </TD>
            </TR>
          </TBODY>
        </TABLE>
      </form>
	
	</td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"><img src="../Images/member/member_12.gif" width="780" height="33"></td>
  </tr>
</table>
<!--#include file="../include/bottom.asp" -->
</body>
</html>

