<!-- #include file="conn.asp"-->
<!-- #include file="bbsuser.asp" -->
<%
   dim sql
   id=request("id")
   sql="select top 1 * from ftbbs_favorites where clubuser_name='"&request.cookies("name")&"' and bbstitleid="&id
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open sql,conn,1,1
   if rs.eof then
      sql="insert into ftbbs_favorites (clubuser_name,bbstitleid,typesign) values('" & request.cookies("name") & "',"&id&",0)"
      conn.execute sql
   else
      response.write "<script language='javascript'>"
      response.write "alert('你已经收藏过该贴子!');"
      response.write "history.go(-1);"
      response.write "</script>"
      response.end    
   end if
   rs.close
   set rs=nothing
   conn.close
   set conn=nothing
   response.redirect request.serverVariables("HTTP_REFERER")
%>
