<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../tgzcm.Scnn.asp" -->
<!--#include file="../tgzcm.Cache/tgzcm.Admin.asp" -->
<%
Call Chkhttp()
Dim UserID,submit,username,password,lname,qq,ask,askok,webcha
submit=Request.QueryString("submit")
username=NoSqlHack(Request.Form("username"))'用户名
password=NoSqlHack(Request.Form("password2"))'用户密码
lname=NoSqlHack(Request.Form("lname"))'用户昵称
qq=NoSqlHack(Request.Form("qq"))'用户QQ
ask=NoSqlHack(Request.Form("ask"))'用户保护问题
askok=NoSqlHack(Request.Form("askok"))'用户保护答案
webcha=NoSqlHack(Request.Form("webcha"))'注册调查
UserID=NoSqlHack(Clng(Request.Form("UserID")))'下线ID
If len(submit)>10 then
    Set rs = Server.CreateObject("adodb.recordset")
    rs.Open"Select * from tgzcm_user where uname='"&username&"'",Conn,1,3
    If rs.Eof And rs.Bof then
	  rs.addnew
	     If username="" or len(username)<6 or len(username)>18 or password="" or lname="" or Not isNumeric(qq) or ask="" or askok="" Then
		 Call tgzcm_err_c("请认真填写注册资料！！！")
         response.End()
		 Else
		 rs("uname")=username
		 rs("upass")=md5(password,32)
		 rs("ulc")=lname
		 rs("uqq")=qq
		 rs("uwww")=webcha
		 rs("uask")=ask
		 rs("uok")=askok
		 rs("uip")=UserTrueIP
		 End If
	  rs.update
	  rs.Close
	  If UserID>0 Then
		 Call NextUser()
	  End if
	  Call tgzcm_err_b("恭喜您，注册成功！！点击确定转向登录页面！","UserLogin.Asp")
	  response.End()
    Else
      Call tgzcm_err_c("用户已经注册,请更换！！！")
      response.End()
    End If
Else
Call tgzcm_err_c("非法操作！！！")
response.End()
End if

Sub NextUser()
  Set nrs=Conn.Execute("Select uid From tgzcm_user order by uid desc")
   If Not(nrs.eof and nrs.bof) Then
     Conn.Execute("Insert into tgzcm_user_jf (jfuid,jfidd) Values('"&UserID&"','"&nrs("uid")&"')")
	 Conn.Execute("update tgzcm_user Set ujf=ujf+"&Cint(tgzcmid(16))&" Where uid="&UserID&"")
   End If
  nrs.Close
  Call CloseConn
End Sub
%>
