You are here:
ColdFusion - a middleware web server technology from Adobe ColdFusion - a middleware web server technology from Adobe

How to issue a Trackback using Adobe ColdFusion and CFHTTP

I've been meaning to get round to having the ability to issue Trackbacks and Pings using my custom built CMS, but also provide my site with the ability to receive Trackbacks and display them for genuine comments and credits from other websites.

I stumbled across a neat little post by Pete Freitag titled Trackbacks with ColdFusion that details how to accomplish this in a few lines of code. Simply using CFHTTP, you can post and credit other websites for their hard work and for saving you time banging your head against a brick wall with a development problem. The example code works as follows:

<cfhttp url="" method="post">
<cfhttpparam name="url" value="" type="formfield" />
<cfhttpparam name="title" value="The Title of My Post" type="formfield" />
<cfhttpparam name="blog_name" value="My Blog Name" type="formfield" />
<cfhttpparam name="excerpt" value="A short excerpt of the posting" type="formfield" />

Now for the XML response. You can simply read the contents of the CFHTTP response using cfhttp.filecontent. If there is a successful response, you should receive an XML response as follows:

<?xml version="1.0" encoding="utf-8"?>

If there is an error in your submission, you will receive a response like the following:

<?xml version="1.0" encoding="utf-8"?>
<message>The error message</message>

Works like a charm. Thanks again to Pete Freitag for the great simple example. Enjoy!