<!--#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)

function rndarray(istart,iend,sum)
'istart和iend是数的开始和结束 sum是你要输出数的个数
dim arrayid(),i,j,blnre,temp,iloop,eloop  
redim arrayid(sum-1)
i=0
iloop=0
eloop=0
blnre=false
randomize 
do while i<sum
temp=int(rnd*(iend-istart+1)+istart)
if i=0 then
arrayid(0)=temp
i=i+1
iloop=iloop+1
else

for j=0 to i-1
if arrayid(j)=temp then
blnre=true
iloop=iloop+1
exit for'这一句很重要，防止多余的循环
else
iloop=iloop+1
end if
next

 if blnre=false then
 arrayid(i)=temp
 i=i+1
 else
 blnre=false
 end if

end if
eloop=eloop+iloop
iloop=0
loop
rndarray=join(arrayid)
end function


function rndarray1(istart,iend,sum)
'istart和iend是数的开始和结束 sum是你要输出数的个数
dim arrayid(),i,j,blnre,temp,iloop,eloop  
redim arrayid(sum-1)
i=0
iloop=0
eloop=0
blnre=false
randomize 
do while i<sum
temp=int(rnd*(iend-istart+1)+istart)
if i=0 then
arrayid(0)=temp
i=i+1
iloop=iloop+1
else

for j=0 to i-1
if arrayid(j)=temp then
blnre=true
iloop=iloop+1
exit for'这一句很重要，防止多余的循环
else
iloop=iloop+1
end if
next

 if blnre=false then
 arrayid(i)=temp
 i=i+1
 else
 blnre=false
 end if

end if
eloop=eloop+iloop
iloop=0
loop
rndarray=join(arrayid)
end function
'response.write rndarray(1,20,10)&"<br>"'调用过程

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



dim sjhm,username,pass,sex,zcip,email,TP
sjhm="13"&rndarray(0,999999999,1)&""
username=""&rndarray(0,9999999,1)&""
pass=""&rndarray(0,9999,1)&""
zcip=Request.ServerVariables("REMOTE_ADDR")
  num222=request.form("num22")
  num111=request.form("num11")





set rs=Server.CreateObject("ADODB.Recordset")
 rs.open"select name from [Users] order by name desc",conn,1,2
if rs("name")=username then
   Call Error("该昵称已经被使用！")
  end if
rs.close
set rs=nothing
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select sjhm from [Users] order by sjhm desc",conn,1,2
if rs("sjhm")=sjhm then
   Call Error("该手机号已经被使用！")
 end if
rs.close
set rs=nothing
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select myip from [Users] order by myip desc",conn,1,2
 if rs("myip")=zcip then
 Call Error("该IP已经被使用！")
 end if
 rs.close
set rs=nothing
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 * 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.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='index.asp?sid="&sid&"&amp;saytk="&saytk&"'>江湖首页</a>"
response.write"<br/><a href='/bbs/index.asp?sid="&sid&"&amp;saytk="&saytk&"'>[社区首页]</a>"
response.write"<br/><a href='../index.asp?sid="&sid&"&amp;saytk="&saytk&"'>[网站首页]</a>"




call head1() %>