<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
bbsuser=trim(request.form("name"))
password=request.form("password")
name=trim(request.form("name"))
if Instr(name,"FileBZ")>0 or Instr(name,"<!--")>0 or Instr(name,"-->")>0 or Instr(name,"=")>0 or Instr(name,"%")>0 or Instr(name,chr(32))>0 or Instr(name,"?")>0 or Instr(name,"&")>0 or Instr(name,";")>0 or Instr(name,",")>0 or Instr(name,"'")>0 or Instr(name,",")>0 or Instr(name,chr(34))>0 or Instr(name,chr(9))>0 or Instr(name,"")>0 or Instr(name,chr(1))>0 then
	response.write "<br><br><center>"
	response.write "用户名中含有非法字符，请重新输入！"
	response.write "</center>"
	response.end
end if
str="select * from clubuser where clubuser_name='"&name&"'"
set rs=server.createobject("adodb.recordset")
rs.open str,conn,3,1
if not rs.eof then
   response.write "<script language='javascript'>"
   response.write "alert('该用户已经有人使用，请重新注册！');"
   response.write "history.go(-1);"
   response.write "</script>"
   response.end
	'msg="该用户已经有人使用，请重新注册！"
	'sign=0
else
sql="select * from clubuser where (clubuser_id is null)"
set rsr=server.createobject("adodb.recordset")
rsr.open sql,conn,1,3
rsr.addnew
rsr("clubuser_name")=name
rsr("clubuser_nickname")=bbsuser
rsr("clubuser_password")=md5(password)
rsr("clubuser_question")=trim(request.form("question"))
rsr("clubuser_answer")=trim(request.form("answer"))
rsr("clubuser_sex")=request.form("sex")
rsr("clubuser_email")=trim(request.form("email"))
rsr("clubuser_reg_date")=now()
rsr("clubuser_lasttime")=now()'最后登录时间
'rsr("login_times")=1'登录次数
rsr("clubuser_ip")=request.servervariables("remote_addr")'ip地址
if request.form("sex")="男" then
   rsr("userimg")="cache37.gif"
else
   rsr("userimg")="cache41.gif" 
end if
rsr.update

session("bbsuser")=bbsuser
session("name")=name
session("bz")=0
session("bbsadmin")=0
session("payuser")=0

Response.Cookies("bbsuser")=bbsuser
Response.Cookies("name")=name
Response.Cookies("bz")=0
Response.Cookies("bbsadmin")=0
Response.Cookies("payuser")=0

Response.Cookies("bbsuser").Expires=date+1
Response.Cookies("name").Expires=date+1
Response.Cookies("bbsadmin").Expires=date+1
Response.Cookies("bz").Expires=date+1
Response.Cookies("payuser").Expires=date+1

msg="恭喜你，注册成功！"
sign=1
smscontent="欢迎您加入本站点参加交流和讨论，本站点为公共论坛，为维护网上公共秩序和社会稳定，请您自觉遵守我们的条款"
end if
str="insert into sms(title,content,accepter,bbssystem) values('"&msg&"','"&smscontent&"','"&name&"',2)"
conn.execute(str)
conn.close
regurl="../bbs/main.asp"
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%if sign=1 then%>
<meta http-equiv="refresh" content="3;URL=<%=regurl%>">
<%end if%>
<BR><BR><BR>
<TABLE border=0 align=center>
<TR>
	<TD align=center>
	<%=msg%><BR><BR>
	<%if sign=0 then%>
	<A HREF="javascript:window.history.back()">[重新注册]</A>
	<%else%>
	系统将在3秒钟后自动返回，您也可以直接手工点击<A HREF="<%=regurl%>"><FONT  COLOR="blue">[返 回]</FONT></A><BR>
	<%end if%>
	</TD>
</TR>
</TABLE>