<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
dim id
id=request.QueryString("id")

set rs1=server.createobject("adodb.recordset")
sql1="select * from sd_hunyin where id="& id
rs1.open sql1,conn,1,3
if clng(rs1("marryid"))<>clng(userid) then
  response.write "<script language='javascript'>alert('你没有权力进行此操作！');history.back(-1)</script>"
  response.end
end if
rs1("status")=1
applyid=rs1("applyid")
marryid=rs1("marryid")
rs1.update
rs1.close

sql2="select username,[match] from user_info where userid="& applyid
rs1.open sql2,conn,1,3
marryname=rs1("username")
rs1("match")=MemberName
rs1.update
rs1.close
set rs1=nothing

set rs2=server.createobject("adodb.recordset")
sql3="select [match] from user_info where userid="& marryid
rs2.open sql3,conn,1,3
rs2("match")=marryname
rs2.update
rs2.close
set rs2=nothing

 conn.close
 set conn=nothing
  BackInfo("virtualmarry.asp")
%>