<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心</title>
<%
Function ChkInvaildWord(Words) 
Const InvaildWords="'|;|<|>|-" ''需要过滤得字符以"|"隔开，最后结束的字符必须是| 

ChkInvaildWord=True 
InvaildWord=Split(InvaildWords,"|") 
inWords=LCase(Trim(Words)) 

For i=LBound(InvaildWord) To UBound(InvaildWord) 
If Instr(inWords,InvaildWord(i))>0 Then 
ChkInvaildWord=True 
Exit Function 
End If 
Next 
ChkInvaildWord=False 
End Function
genkey=gen_key(20)
from=session("from")
if from="" then
from="index.asp"
end if
action=request.QueryString("action")
if action="reg" then
M_login=request.Form("M_login")
M_pwd=request.Form("M_pwd")
M_pwd2=request.Form("M_pwd2")
M_email=request.Form("M_email")

if ChkInvaildWord(M_login) or ChkInvaildWord(M_pwd) or ChkInvaildWord(M_pwd) then


call box("输入内容包含敏感字符，请重新输入!","back","error")
end if

if M_pwd<>M_pwd2 then

call box("两次输入密码不一致!","back","error")
end if

if M_login<>"" and M_pwd<>"" and M_email<>"" then
if InStr(M_email,"@")=0 then

call box("请输入一个可用的邮箱!","back","error")
else
sql="Select * from SL_member Where M_login='"&M_login&"'"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then

call box("用户名已被占用!","back","error")
rs.close
set rs=nothing
else
sql="insert into SL_member(M_login,M_pwd,M_email,M_fen,M_pic,M_regtime) values('"&M_login&"','"&M_pwd&"','"&M_email&"',0,'member.jpg','"&now()&"')"
conn.Execute(sql)

call box("注册成功!您可以登录了！","member_login.asp","success")
end if
end if
else

call box("请填全信息!","back","error")
end if
end if
%>
<link type="text/css" rel="stylesheet" href="css/style.css"  />
<SCRIPT LANGUAGE="JavaScript" src="js/help2.js"></SCRIPT>
<script src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function test(){
$.post("post.asp",
    {
      genkey:"<%=genkey%>",
    },
    function(data){
	if(data==1){
	document.location.href='<%=URLDecode(from)%>'
	}
    });
}
setInterval("test()",3000); //每3秒钟执行一次test()
</SCRIPT>
</head>
<body>


<div class="panel panel-t1 panel-login-new" style=" position: fixed; width: 540px; z-index: 101; left: 50%; top: 50%; margin-left:-270px;margin-top:-250px; " id="BAIDU_PANEL_5">
  <div class="panel-content" id="panel-content">
    <div style="text-align:center"><a href="../"><img src="../<%=C_logo%>"></a></div>
    <div class="hd">
      <h3>注册</h3>
     
    </div>
    <div class="bd">
      <div class="panel panel-login-new" id="BAIDU_PANEL_4">
        <div class="panel-content">
          <div class="bd">
            <div style="margin-top:6px;"></div>
            <div class="panel-login-cont-bd cls">
              <div class="panel-login-cont-l">
                <p>已有帐号？</p>
                <a  class="login-btn _hrefAddRef" target="_self" href="member_login.asp">立即登录</a>
                <div class="login-btns">
                  <p>使用合作网站帐号登录</p>
                  <a  style=" margin-top:6px;" class="third-login third-party-btn qq _hrefAddRef" target="_self" data-type="third" href="<%=C_dir%>qq/qqlogin.asp">QQ帐号</a>
				  <a title="<div style='text-align:center; background:#FFFFFF; padding:10px;'>使用微信扫一扫<br><img src='http://paysdk.weixin.qq.com/example/qrcode.php?data=http://<%=C_domain%><%=C_dir%>wxpay/login.asp?genkey=<%=genkey%>' width='150'></div>" style=" margin-top:6px;" class="third-login third-party-btn qihu360 _hrefAddRef" target="_self" data-type="third" href="javascript:;">微信账号</a>
				  </div>
              </div>
              <div class="panel-login-cont-r">
                <form action="member_reg.asp?action=reg" name="loginForm" method="post" class="panel-login-form">
                  <ul>
                    <li>
                      <label class="k" for="a1">登陆帐号：</label>
                      <span class="v">
                      <input type="text" id="uname" emel="error_txt" datatype="magic-mobilecode||email" errmsg="帐号格式有误，请重新输入" reqmsg=" 请填写你的登录邮箱或手机" data-placeholder="请输入邮箱/手机" name="M_login" emptyhintel="emptyhint-10000" value="请输入账号" onfocus="if(this.value=='请输入账号'){this.value='';}" onblur="if(this.value==''){this.value='请输入账号';}">
                      </span> </li>
                    <li>
                      <label class="k" for="a2">登录密码：</label>
                      <span class="v">
                      <input type="password" emel="error_txt" id="password" name="M_pwd" data-placeholder="请输入密码" reqmsg="请填写密码" emptyhintel="emptyhint-10001">
                      </span> </li>
					  <li>
                      <label class="k" for="a2">重复密码：</label>
                      <span class="v">
                     <input type="password" emel="error_txt" id="password" name="M_pwd2" data-placeholder="请输入密码" reqmsg="请填写密码" emptyhintel="emptyhint-10001">
                      </span> </li>
					  <li>
                      <label class="k" for="a2">电子邮箱：</label>
                      <span class="v">
                     <input type="text" id="uname" emel="error_txt" datatype="magic-mobilecode||email" errmsg="帐号格式有误，请重新输入" reqmsg=" 请填写你的登录邮箱或手机" data-placeholder="请输入邮箱/手机" name="M_email" emptyhintel="emptyhint-10000" value="请输入电子邮箱" onfocus="if(this.value=='请输入电子邮箱'){this.value='';}" onblur="if(this.value==''){this.value='请输入电子邮箱';}">
                      </span> </li>
                  </ul>
                  <div class="error-txt"><em id="error_txt"></em></div>

                  <div class="btns">
                    <input class="btn-login" type="submit" id="submit_button" value="注册">
                    <input class="btn-login btn-active" style="display:none" type="submit" value="注册中...">
                  </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
    
    </div>
    <div class="ft"></div>
  </div>
  <span class="sd"></span><span class="close"></span>
  </div>
  
  
</body>
</html>