<% if EnableUserReg<>"Yes" then FoundErr=true ErrMsg=ErrMsg & "
  • 对不起,本站暂停新用户注册服务!
  • " call WriteErrMsg() response.end end if const ChannelID=2 Const ShowRunTime="Yes" SkinID=0 dim RegUserName,Password,PwdConfirm,Question,Answer,Sex,Email,Homepage,QQ,MSN RegUserName=trim(request("UserName")) Password=trim(request("Password")) PwdConfirm=trim(request("PwdConfirm")) Question=trim(request("Question")) Answer=trim(request("Answer")) Sex=trim(Request("Sex")) Email=trim(request("Email")) Homepage=trim(request("Homepage")) if Homepage="http://" or isnull(Homepage) then Homepage="" QQ=trim(request("QQ")) MSN=trim(request("MSN")) dim CheckNum,CheckUrl randomize CheckNum = int(7999*rnd+2000) '随机验证码 CheckUrl=Request.ServerVariables("HTTP_REFERER") CheckUrl=left(CheckUrl,instrrev(CheckUrl,"/")) & "User_RegCheck.asp?Action=Check&UserName=" & RegUserName & "&Password=" & Password & "&CheckNum=" & CheckNum if RegUserName="" or strLength(RegUserName)>14 or strLength(RegUserName)<4 then founderr=true errmsg=errmsg & "
  • 请输入用户名(不能大于14小于4)
  • " else if Instr(RegUserName,"=")>0 or Instr(RegUserName,"%")>0 or Instr(RegUserName,chr(32))>0 or Instr(RegUserName,"?")>0 or Instr(RegUserName,"&")>0 or Instr(RegUserName,";")>0 or Instr(RegUserName,",")>0 or Instr(RegUserName,"'")>0 or Instr(RegUserName,",")>0 or Instr(RegUserName,chr(34))>0 or Instr(RegUserName,chr(9))>0 or Instr(RegUserName,"")>0 or Instr(RegUserName,"$")>0 then errmsg=errmsg+"
  • 用户名中含有非法字符
  • " founderr=true end if end if if Password="" or strLength(Password)>12 or strLength(Password)<6 then founderr=true errmsg=errmsg & "
  • 请输入密码(不能大于12小于6)
  • " else if Instr(Password,"=")>0 or Instr(Password,"%")>0 or Instr(Password,chr(32))>0 or Instr(Password,"?")>0 or Instr(Password,"&")>0 or Instr(Password,";")>0 or Instr(Password,",")>0 or Instr(Password,"'")>0 or Instr(Password,",")>0 or Instr(Password,chr(34))>0 or Instr(Password,chr(9))>0 or Instr(Password,"")>0 or Instr(Password,"$")>0 then errmsg=errmsg+"
  • 密码中含有非法字符
  • " founderr=true end if end if if PwdConfirm="" then founderr=true errmsg=errmsg & "
  • 请输入确认密码(不能大于12小于6)
  • " else if Password<>PwdConfirm then founderr=true errmsg=errmsg & "
  • 密码和确认密码不一致
  • " end if end if if Question="" then founderr=true errmsg=errmsg & "
  • 密码提示问题不能为空
  • " end if if Answer="" then founderr=true errmsg=errmsg & "
  • 密码答案不能为空
  • " end if if Sex="" then founderr=true errmsg=errmsg & "
  • 性别不能为空
  • " else sex=cint(sex) if Sex<>0 and Sex<>1 then Sex=1 end if end if if Email="" then founderr=true errmsg=errmsg & "
  • Email不能为空
  • " else if IsValidEmail(Email)=false then errmsg=errmsg & "
  • 您的Email有错误
  • " founderr=true end if end if if QQ<>"" then if not isnumeric(QQ) or len(cstr(QQ))>10 then errmsg=errmsg & "
  • QQ号码只能是4-10位数字,您可以选择不输入。
  • " founderr=true end if end if if MSN<>"" then if IsValidEmail(MSN)=false then errmsg=errmsg & "
  • 你的MSN有误。
  • " founderr=true end if end if if founderr=false then dim sqlReg,rsReg sqlReg="select * from " & db_User_Table & " where " & db_User_Name & "='" & RegUserName & "'" set rsReg=server.createobject("adodb.recordset") rsReg.open sqlReg,Conn_User,1,3 if not(rsReg.bof and rsReg.eof) then founderr=true errmsg=errmsg & "
  • 你注册的用户已经存在!请换一个用户名再试试!
  • " else rsReg.addnew rsReg(db_User_Name)=RegUserName rsReg(db_User_Password)=md5(Password) rsReg(db_User_Question)=Question rsReg(db_User_Answer)=md5(Answer) rsReg(db_User_Sex)=Sex rsReg(db_User_Email)=Email rsReg(db_User_Homepage)=Homepage rsReg(db_User_QQ)=QQ rsReg(db_User_Msn)=MSN rsReg(db_User_RegDate)=Now() rsReg(db_User_ArticleCount)=0 rsReg(db_User_ArticleChecked)=0 rsReg(db_User_LoginTimes)=1 rsReg(db_User_LastLoginTime)=NOW() rsReg(db_User_ChargeType)=ChargeType_999 rsReg(db_User_UserPoint)=UserPoint_999 rsReg(db_User_BeginDate)=formatdatetime(now(),2) rsReg(db_User_Valid_Num)=ValidDays_999 rsReg(db_User_Valid_Unit)=1 if EmailCheckReg="Yes" then rsReg(db_User_UserLevel)=3000 call SendRegEmail() else if AdminCheckReg="Yes" then rsReg(db_User_UserLevel)=2000 else rsReg(db_User_UserLevel)=999 Response.Cookies("asp163")("UserName")=RegUserName Response.Cookies("asp163")("Password") =md5(Password) Response.Cookies("asp163")("UserLevel")=999 end if end if if UserTableType="Dvbbs6.0" or UserTableType="Dvbbs6.1" then rsReg(db_User_UserClass) = FU_UserClass rsReg(db_User_TitlePic) = FU_TitlePic rsReg(db_User_UserGroupID) = FU_UserGroupID rsReg(db_User_Face) = FU_Face rsReg(db_User_FaceWidth) = FU_FaceWidth rsReg(db_User_FaceHeight) = FU_FaceHeight rsReg(db_User_UserWealth) = FU_UserWealth rsReg(db_User_UserEP) = FU_UserEP rsReg(db_User_UserCP) = FU_UserCP rsReg(db_User_UserGroup) = FU_UserGroup rsReg(db_User_Showre) = FU_Showre end if rsReg.update call UpdateUserNum(RegUserName) end if rsReg.close set rsReg=nothing end if PageTitle="注册成功" %> <%=strPageTitle & " >> " & PageTitle%> <% call MenuJS() %>
    ·注册<%=SiteName%>

      注册步骤
      一、阅读并同意协议
      二、填写注册资料
      三、完成注册
    <% if founderr=false then call RegSuccess() else call WriteErrmsg() end if %>

    <% call Bottom() %> <% call CloseConn call CloseConn_User sub WriteErrMsg() response.write "

    " response.write "" response.write "" response.write "
    由于以下的原因不能注册用户!

    " & errmsg & "

    返 回

    " end sub sub RegSuccess() response.write "

    " response.write "" response.write "" response.write "
    成功注册用户!

    你注册的用户名:" & RegUserName & "
    " if EmailCheckReg="Yes" then response.write "系统已经发送了一封确认信到你注册时填写的信箱中,你必须在收到确认信并通过确认信中链接进行确认后,你才能正式成为本站的注册用户。" else if AdminCheckReg="Yes" then response.write "请等待管理通过你的注册申请后,你就可以正式成为本站的注册用户了。" else response.write "欢迎您的加入!!!" end if end if response.write "

    关 闭

    " end sub sub SendRegEmail() dim MailtoAddress,MailtoName,Subject,MailBody,FromName,MailFrom,Priority MailtoAddress=Email MailtoName=RegUserName Subject="注册确认信" MailBody="这是一封注册确认信。你的验证码是:" & CheckNum & vbcrlf & "
    请点此进行确认:" & CheckUrl & "" FromName=SiteName MailFrom=WebmasterEmail Priority=3 ErrMsg=SendMail(MailtoAddress,MailtoName,Subject,MailBody,FromName,MailFrom,Priority) if ErrMsg<>"" then FoundErr=True end sub %>