<!--#include file="../conn/conn2.asp" -->
<%
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

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
Response.Write"<script>alert('输入内容包含敏感字符，请重新输入!');history.back();</script>"
response.end
end if

if M_pwd<>M_pwd2 then
Response.Write"<script>alert('两次输入密码不一致!');history.back();</script>"
response.End()
end if

if M_login<>"" and M_pwd<>"" and M_email<>"" then
if InStr(M_email,"@")=0 then
Response.Write"<script>alert('请输入一个可用的邮箱!');history.back();</script>"
else
sql="Select * from member Where M_login='"&M_login&"'"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
Response.Write"<script>alert('用户名已被占用!');history.back();</script>"
rs.close
set rs=nothing
else
sql="insert into member(M_login,M_pwd,M_email,M_fen) values('"&M_login&"','"&M_pwd&"','"&M_email&"',0)"
conn.Execute(sql)
Response.Write"<script>alert('注册成功!您可以登录了！');window.location='member_login.asp';</script>"
end if
end if
else
Response.Write"<script>alert('请填全信息!');history.back();</script>"
end if
end if
%>
<!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=gb2312" />
<title>会员中心</title>
<style type="text/css">
			html {
				overflow:auto;
			}
			body { 
				background-color: transparent; 
				font-size:12px;
				line-height:180%;
				font-family:"微软雅黑";
				
			}
			a{ font-size:12px; color:#777777; text-decoration:none;}
			a:hover {color:#0066ff;text-decoration: underline}
			.input {border-top:1px solid #ABADB3;border-left:1px solid #ABADB3;border-right:1px solid #ddd;border-bottom:1px solid #ddd;height:24px;width:300px;padding:0 5px;}
</style>
</head>
<body>
<div style="width:420px; padding-top:100px; padding-left:150px;">
<h2>注册会员</h2>
<hr>
<form action="member_reg.asp?action=reg" method="post">
<table width="400px">
<tr><td>登录账号</td><td><input type="text" name="M_login" class="input"></td></tr>
<tr><td>登录密码</td><td><input type="password" name="M_pwd" class="input"></td></tr>
<tr><td>重复密码</td><td><input type="password" name="M_pwd2" class="input"></td></tr>
<tr><td>电子邮箱</td><td><input type="text" name="M_email" class="input"></td></tr>
<tr><td></td><td><input type="submit" value="确认" style="width:80px;height:30px; border:hidden; background-color:#FF9900; color:#FFFFFF; font-family:'微软雅黑'; font-size:15px;"> <input type="button" value="返回" onclick="javascript:history.go(-1)" style="width:80px;height:30px; border:hidden; background-color:#0099FF; color:#FFFFFF; font-family:'微软雅黑'; font-size:15px;"></td></tr>
</table>
</form>
</div>
</body>
</html>