<!--#include file="Inc.asp"-->
<!--#include file="forbbs.asp"-->
<!--#include file="../Inc/chinahanzi.asp"-->
<!--#include file="md5.asp"-->

<%call head()
Call saycarda("注册会员")

Dim ss
randomize timer
ss=Left(Int((99999)*Rnd +10000),4)

if regset="1" or regset="4" then
    Call Error("手工注册已关闭！")
  end if
  regxx=request("regxx")

If regxx="" Then
%><%=ubbcode(regxy)%><%
If saytk=100 Then response.write"<div class=""path"">"
%>



<% 
If saytk=100 Then Response.write "</div><div class=""content red"">"
response.write "<a href=""reg.asp?regxx=1&amp;saytk="&saytk&"&amp;sid="&sid&""">我同意并遵守以上协议</a><br/>"
response.write "<a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">我不同意以上协议</a><br/>"
If saytk=100 Then Response.write "</div>"
Call head1()
response.End 
end if


dim sjhm,username,pass,sex,zcip,email,TP
sjhm=usb(request("sjhm"))
username=forbbs(request("username"))
pass=usb(request("pass"))
email=usb(request("email"))
sex=usb(request("sex"))
TP=usb(request("TP"))
zcip=Request.ServerVariables("REMOTE_ADDR")
  num222=request.form("num22")
  num111=request.form("num11")


if TP<>"" then

if sjhm="" or pass="" or username="" then
    Call Error("请填写完整！")
  end if

if len(username) > 10 then
  Call Error("会员昵称不能超过10个字！")
end If
if email="@" Then
response.write "请认真填写邮箱，找回密码必用！<br/><a href=""reg.asp?saytk="&saytk&""">返回重写</a>"
	 Call headsay()
     response.end
end if

if Instr(username,"爷") or Instr(username,"奶") or Instr(username,"爸") or Instr(username,"妈") or Instr(username,"爹") then
  Call Error("系统限制昵称“"&username&"”，请重新输入！")
end If



if CLng(num111)<>CLng(num222) then
     response.write "对不起，您填的验证码与系统不相符合，返回后请重新输入！<br/><a href=""reg.asp?regxx=1&amp;saytk="&saytk&""">返回重写</a>"
	 Call headsay()
     response.end
End if 


'过滤昵称
dim h
for h = 1 to len(username)
  if Instr(chinahanzi,mid(username,h,1))=0 then
  Call Error("会员昵称只能是汉字、字母、数字组成！")
  end if
next

if ifbadchr("abcdefghijklmnopqrstuvwxyz0123456789",pass) > 0 or len(pass) < 4 or len(pass) > 15 then

 Call Error("密码必须是4至15位的英文小写字母或数字的组合！")
  end if

if Isnumeric(sjhm)=false then 
    Call Error("请输入正确的手机号！")
  end if
if len(sjhm)<>11 then 
    Call Error("请输入正确的手机号！")
  end if
if left(sjhm,1)<>1 then 
    Call Error("请输入正确的手机号！")
  end if
set rs=Server.CreateObject("ADODB.Recordset")
 rs.open"select name from [Users] where name='"&username&"'",conn,1,2
if not rs.eof then
   Call Error("该昵称已经被使用！")
  end if
rs.close
set rs=nothing
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select sjhm from [Users] where sjhm='"&sjhm&"'",conn,1,2
if not rs.eof then
   Call Error("该手机号已经被使用！")
 end if
rs.close
set rs=nothing
if xzzcip=1 then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select myip from [Users] where myip='"&zcip&"'",conn,1,2
if not rs.eof then
 Call Error("该IP已经被使用！")
 end if
 rs.close
set rs=nothing
end if
if xzdlgip=1 then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select myip from [Users] where loginip='"&zcip&"'",conn,1,2
if not rs.eof then
 Call Error("该IP已经登录过帐号无法注册！")
 end if
 rs.close
set rs=nothing
end if
dim siddd
Function SID_RANDOMIZE()
Dim c,id
randomize 
c="a,A,1,b,B,2,c,C,3,d,D,4,e,E,5,f,F,6,g,G,7,h,H,8,i,I,9,j,J,0,k,K,1,l,L,2,m,M,3,n,N,4,o,O,5,p,P,6,q,Q,7,r,R,8,s,S,9,t,T,0,u,v,w,x,y,z,"
id=split(c,",") 
for i=1 to 10
SID_RANDOMIZE=int(rnd()*36)&SID_RANDOMIZE
Next
SID_RANDOMIZE=SID_RANDOMIZE&minute(now)&second(now)&day(now)&month(now)
End Function
siddd=md5(md5(sjhm+SID_RANDOMIZE,16),32)
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select sjhm,mm,answer,sex,name,myip,email,regtime,zcfs,listnum,viewnum,review,relistnum,about,datainfo,ttvv from [Users]",conn,1,2
rs.addnew
rs("sjhm")=sjhm
rs("mm")=pass
rs("answer")=aqm
rs("sex")=sex
rs("name")=username
rs("myip")=zcip
if email<>"" then rs("email")=email
rs("regtime")=now()
rs("zcfs")="手工注册"
rs("listnum")=8
rs("viewnum")=500
rs("review")=3
rs("relistnum")=8
rs("about")=""&reggxjs&""
rs("datainfo")=""&reggxqm&""
rs("ttvv")=1
rs.update
rs.close
set rs=nothing
dim clicksendid
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select top 1 id from [Users] order by id desc",conn,1,1
sid=rs("id")&"_"&siddd
clicksendid=rs("id")
conn.Execute("update Users set sid='"&sid&"' Where id="&rs("id"))
response.write"注册成功，您的ＩＤ:"&rs("id")
response.write"<br/>手机号码为"&sjhm
response.write"<br/>用户密码为"&pass
response.write"<br/>用户安全串号SID为"&rs("id")&"_"&siddd&""
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','(url=/bbs/uinfo.asp?id="&clicksendid&"&amp;sid=[sid])"&username&"(/url)加入了(url=/bbs/?sid=[sid])"&bbstitle&"(/url)')")
rs.close
set rs=nothing

dim msgx
msgx = "恭喜！会员注册成功！"
msgx = msgx & "\\会员ID:" & clicksendid
msgx = msgx & "\\密码:" & pass & ""
msgx = msgx & "\\为了您的帐号安全，请您及时修改密码"
msgx = msgx & "\\(url=clickid.asp?Action=ok&saytk=[saytk]&sid=[sid])我要填写我的推荐人(/url)"
msgx = msgx & "\\(url=clickid.asp?Action=no&saytk=[saytk]&sid=[sid])我没有推荐人,不填写(/url)"
msgx = msgx & "\\ 温馨提示:推荐成功后.您的推荐人会得到"&clickjb&getcent&"的奖励,同时您也会得到"&regjb&getcent&",不推荐也有"&regjb&getcent&"奖励哦！"

set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest",conn,1,2
rs.addnew
rs("fnr")=msgx
rs("sid")=clicksendid
rs("fid")=0
rs.update
rs.close
set rs=nothing

conn.close
set conn=nothing








response.write"<br/><a href='show.asp?sid="&sid&"&amp;saytk="&saytk&"'>我的空间</a>"
response.write"<br/><a href='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>[社区首页]</a>"
response.write"<br/><a href='../index.asp?sid="&sid&"&amp;saytk="&saytk&"'>[网站首页]</a>"

else

if saytk<>1 then
	Response.write "<form name=""form"" method=""post"" action=""reg.asp?regxx=1&amp;TP=OK&amp;saytk="&saytk&""">"
end If
if saytk<>1 Then
%>
<span style="color:#800000;display:inline">
<%End If 
If saytk=100 Then
%><div class="toper"><img src="/img/logo.jpg" alt="."/></div><div class="path"><%
End If
%>

免费注册|<a href="login.asp?saytk=<%=saytk%>">会员登陆</a><br/><%
If saytk=100 Then Response.write "</div>"
if saytk<>1 Then
%>
</span><div class="content">
<%End If%>

手机号码<br/><input name="sjhm" title="手机号：" type="text" format="*M" emptyok="true" maxlength="11" value=""/><br/>
登录密码<br/><input name="pass" title="登陆密码" type="text" format="*M" emptyok="true" maxlength="500" value=""/><br/>
会员昵称<br/><input name="username" title="昵称" type="text" format="*M" emptyok="true" maxlength="500" value=""/><br/>
性别<select name='sex' value='2'>
<option value="1">男性</option>
<option value="2">女性</option>
<option value="3">保密</option>
</select><br/>
邮箱(方便取回密码)<br/>
<input name="email" title="密码问题" type="text" format="*M" emptyok="true" maxlength="50" value="@"/><br/>
验证码:<%=ss%><br/>
<input name="num11" type="text" format="*M" emptyok="true" maxlength="4"/>
<a href="reg.asp?regxx=1&amp;t=<%=timer()%>&amp;saytk=<%=saytk%>">刷新</a><br/>


<%


if saytk<>1 then 
response.write "<input type=""hidden"" name=""num22"" value="""&ss&"""/>"
response.write "<input type=""submit"" name=""submit"" value=""提交注册""/></form><br/>"
else
%>
<anchor>提交注册
<go href="reg.asp?regxx=1&amp;saytk=<%=saytk%>" method="post" accept-charset="utf-8">
<postfield name="sjhm" value="$(sjhm)"/>
<postfield name="pass" value="$(pass)"/>
<postfield name="username" value="$(username)"/>
<postfield name="sex" value="$(sex)"/>
<postfield name="num11" value="$(num11)"/>
<postfield name="num22" value="<%=ss%>"/>
<postfield name="email" value="$(email)"/>
<postfield name="codecheck" value="$(codecheck)"/>
<postfield name="TP" value="ok"/>
</go></anchor>
<%end If%>
<br/>--------<br/>


=最新注册前5位=<br/><%

set rs=conn.execute("select top 5 * from [users] order by id desc")
while not rs.eof 
if len(rs("name"))>7 then
response.write left(rs("name"),7)&"****" &" TEL:"&left(rs("sjhm"),7)&"**** "
 response.write date_dongtai(rs("regtime"))
  response.write"前<br/>"
else
response.write rs("name")&" "&left(rs("sjhm"),7)&"**** "
 response.write date_dongtai(rs("regtime"))
   response.write"前<br/>"
end if
rs.movenext
wend
rs.close
set rs=nothing
If saytk=100 Then Response.write "</div><div class=""path"">"
If saytk>1 Then 

response.write"<a href=""javascript:window.history.go(-1);"">>>返回上一页</a><br/>"
Else
response.write"<anchor>返回上级<prev/></anchor><br/>"
End If
If saytk=100 Then Response.write "</div>"
If saytk=100 Then Response.write "<div class=""path"">"
%>


<a href="login.asp?saytk=<%=saytk%>">返回登陆</a><br/><a href="/index.asp?saytk=<%=saytk%>">返回首页</a>

<%
If saytk=100 Then Response.write "</div>"
end If

call head1() %>