<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
response.Charset="utf-8"
response.ContentType="text/xml"
%>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
dim checkusername
checkusername=session("TotCms_UserName")
'''''''''''''''''''''''''''''''''''''''''''''''
dim sql,rs,f_title,f_url,f_type
f_title=request.QueryString("f_title")
f_url=request.QueryString("f_url")
f_type=request.QueryString("f_type")
response.Write("<?xml version=""1.0"" encoding =""utf-8""?>"&Chr(13))
response.Write("<root>"&Chr(13))

if(checkusername<>"") then
	set rs=server.CreateObject("adodb.recordset")
	sql="select * from t_favorite where f_userid='"&checkusername&"' and f_url='"&f_url&"'"
	rs.open sql,conn,3,3
	if not rs.eof then
	else
		rs.addnew
		rs("f_userid")=checkusername
		rs("f_title")=f_title
		rs("f_url")=f_url
		rs("f_type")=f_type
		rs.update
	end if
	rs.close
	set rs=nothing
	response.Write("<result return=""success"" />"&Chr(13))
else
	response.Write("<result return=""error"" />"&Chr(13))
end if
response.Write("</root>"&Chr(13))
call connclose()
%>