

<object runat="server" id="conn1" progid="adodb.connection"></object>
<%application.Lock
conn1.Open Application("p_jyzx")
Application.UnLock
%>
<%user_name=trim(Request("user_name"))
 forbid_str=Split(Application("forbid_str"),",")
	For i = LBound(forbid_str) to UBound(forbid_str) step 1
		
		if UCase(forbid_str(i))=UCase(user_name) then
			Response.Redirect "error.asp?cause=7"
		end if
	next
 

sql="select * from user where user_name='"&Request("user_name")&"'"
set rs=server.CreateObject ("ADODB.recordset")
 rs.Open sql,conn1,3
if rs.RecordCount <>0 then
  Response.Redirect "error.asp?cause=3"
end if 
	
'//////////////////////////////////////////
   user_name=Request("user_name")
   set rs=server.CreateObject ("ADODB.recordset")
   rs.Supports (adAddNew)
   rs.Open "select * from user",conn1,2,3 
  
   
   rs.AddNew 
   rs("user_name")=user_name
   rs("passwd")=Request("Password")
   rs("nickname")=Request("nickname")
   rs("passwd_question")=Request("question")
   rs("passwd_answer")=Request("answer")
   rs("weight")=1
   rs("public_select")=2
   rs("counter")=0
   rs("visited_counter")=0
   rs("charisma")=0
  '///////////////////////
   rs("nation")=Request("nation")
    rs("friend_object")=Request("friend_object")
     rs("shengxiao")=Request("shengxiao")
      rs("work_status")=Request("work_status")
       rs("work_position")=Request("work_position")
        rs("work_province")=Request("work_province")
   rs("work_city")=Request("work_city")
       rs("dangwei")=Request("dangwei")
   rs("house")=Request("house")
  '//////////////////////
   
   rs("sex")=Request("sex")
   rs("byear")=Request("byear")
   rs("bmonth")=Request("bmonth")
   rs("bday")=Request("bday")
 
   rs("email")=trim(Request("email"))
   rs("telephone")=Request("telephone")
   rs("province")=Request("place")
   rs("city")=Request("city")
   rs("vocation")=Request("job")
   rs("employment")=Request("jobtitle")
   rs("education")=Request("edu")
   rs("salary")=Request("income")
   rs("constellation")=Request("constellation")
   rs("blood")=Request("blood")
   rs("married")=Request("martial")
   rs("relation")=Request("relation")
   rs("photo")=0
   rs("sound")=0
   rs("reg_date")=date
   rs("last_time")=date
   rs.Update 
 
%>

<%
  set rs1=server.CreateObject ("ADODB.recordset")
  rs1.Supports (adAddNew)
  rs1.Open "select * from user_info",conn1,2,3 
  rs1.AddNew 
 rs1("user_name")=user_name
 rs1("language")="000000000000"
  rs1("height")=0
  rs1("shape")="保留"
  rs1("health")="保留"
  rs1("smoking")="保留"
  rs1("drinking")="保留"
 
  rs1("homepage")="http://"
  rs1("homeintro")="?T"
  rs1("character")="000000000000000000000000000000000000000000000000000000000000"
    rs1("favourite")="000000000000000000000000"
    rs1("f_sports")="00000000000000000000000"
    rs1("f_season")="0000"
    rs1("f_movie")="0000000000000"
    rs1("f_music")="00000000"
    rs1("f_food")="000000000000000"
    rs1("dress_up")="保留"
  rs1.Update 
 

%>
<%if session("from_intr")<>"__anonymous" then
	  Set rs = Server.CreateObject("ADODB.Recordset")
	 sql="select * from affiliate where user_name='"&session("from_intr")&"'"
	rs.Open sql,conn1,3,2
	if rs.RecordCount<>0 then
	
	  Set rs_join = Server.CreateObject("ADODB.Recordset")
	 rs_join.Open "affiliate_intro",conn1,3,2
	rs_join.AddNew 
	rs_join("user_name")=session("from_intr")
	rs_join("introduced_user")=user_name
	rs_join("ip")=Request.ServerVariables("REMOTE_HOST")
	rs_join("time")=now()
	rs_join.Update 
		
	
	 Set rs = Server.CreateObject("ADODB.Recordset")
	 sql="select * from affiliate where user_name='"&session("from_intr")&"'"
	rs.Open sql,conn1,2,3
	
   
    'rs("link")=link
    'rs("visit_counter")=0
    rs("join_counter")=rs("join_counter")+1
    'rs("start_time")=date
    rs.Update
    end if

end if
%>
<%'////////////发注册成功确认邮件
'////////////////////////////////

   
 body=body&"---------"&chr(13)
 body=body&"  祝贺您，您已经成功地注册成为"&Application("web_name")&"的一员"&chr(13)
 body=body&"  您的用户名为："&user_name&" 密码："&Request("Password")&chr(13)
 body=body&Application("web_name")&"网欢迎您 "&Application("web_address")&chr(13)

    topic= "欢迎成为"&Application("web_name")&"的一员"
	SMTPServer=trim(Application("SMTPServer"))
	SMTPServer_username=Application("SMTPServer_username")
    SMTPServer_passwd=Application("SMTPServer_passwd")
	SystemEmail=Application("SystemEmail")
	SenderName=Application("SenderName")	
	on error resume next
	dim msg,SendMail
	Set msg = Server.CreateObject("JMail.Message")

		msg.silent = true
		msg.Logging = true
		msg.Charset = "gb2312"
		msg.MailServerUserName = SMTPServer_username
		msg.MailServerPassword = SMTPServer_passwd
		msg.From = SystemEmail
		msg.FromName = SenderName
		msg.AddRecipient trim(Request("email")),user_name
		msg.Subject = topic
		msg.Body = body
		msg.Send (SMTPServer)
	set msg=nothing
	
	Response.Redirect "reg_success.asp"

%>

