<!--#include file="conn.asp" -->
<%
if not request.QueryString("act")="post" then
dim blogId,excerpt,url,topic,blogname,sql
blogid =clng(trim(request.QueryString("id")))
excerpt = replace(trim(request("excerpt")),"'","''")
url = replace(trim(request("url")),"'","''")
topic = replace(trim(request("topic")),"'","''")
blogname = replace(trim(request("blogname")),"'","''")
if topic="" then topic = url
if not blogid="" then
	if not url="" then
	sql = "insert into trackback (blogid,excerpt,url,topic,blogname,addtime) values ("&blogid&",'"&excerpt&"','"&url&"','"&topic&"','"&blogname&"','"&now()&"')"
	conn.Execute(sql)
	conn.execute("update [blog] set trackback=trackback+1 where id="&blogid)
	call closeconn
%>
<?xml version="1.0" encoding="gb2312"?>
<response>
<error>0</error>
</response>
<%	
	else 'url
%>
<?xml version="1.0" encoding="iso-8859-1"?>
<response>
<error>1</error>
<message>Need url</message>
</response>
<%
	end if 'url
else
%>
<?xml version="1.0" encoding="iso-8859-1"?>
<response>
<error>1</error>
<message>Need blogid</message>
</response>
<%
end if 'blogArId

else ''act=post
%>
<form name="tbF" method="post" action="">
	title
		<input name="topic" type="text" id="topic">
        <br>
        url
        <input name="url" type="text" id="url">
        <br>
        excerpt
        <input name="excerpt" type="text" id="excerpt">
        <br>
        blog_name
        <input name="blogname" type="text" id="blogname">
</form>
<%
end if ''act=post
%>
