<%@ Language=VBScript %>

<%if Session("weight")=0 then 
Response.Redirect "error.asp?cause=4"
 end if
%>
<object runat=server id=conn1 progid="adodb.connection"></object>
<%application.Lock
conn1.Open Application("p_jyzx")
Application.UnLock
%>
<%

set rs1=server.CreateObject ("ADODB.recordset")
sql="select * from join_party where user_name='"&session("Current_user")&"'"
sql=sql&" and id="&Request("id")
rs1.Open sql,conn1,3
if rs1.RecordCount=0 then
		set rs2=server.CreateObject ("ADODB.recordset")
		sql="select * from user where user_name='"&session("Current_user")&"'"
		rs2.Open sql,conn1,3
		if rs2.RecordCount<>0 then
			sex=rs2("sex")
			age=year(date)-clng(rs2("byear"))
			nickname=rs2("nickname")
			photo=rs2("photo")
		end if
		rs2.Close
		
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open "join_party",conn1,3,2
	rs.addnew
	
	rs("user_name")=session("Current_user")
	rs("id")=Request("id")
	rs("initiate_people")=Request("initiate_people")
	rs("nickname")=nickname
	rs("sex")=sex
	rs("age")=age
	rs("photo")=photo
	rs("time")=now()
	rs.update
	rs.Close 
	end if
	rs1.Close 
Response.Redirect "party_2.asp?id="&Request("id")



%>