<?php
/* Created: 2/26/2007
trackbacktest.php -> original code by TDavid @ tdscripts.com
License: Creative Commons 2.5 Attribution
requires cURL library

Warning: don't leave this in a location where anybody can use it or it could be used to send trackback spam!
*/

$send_trackback = $_POST['sendtb']; // this is where to send trackback

$tb_url    = $_POST['url'];
$title     = $_POST['title'];
$excerpt   = $_POST['excerpt'];
$blog_name = $_POST['blog_name'];
$charset2= $_POST['charset2'];
$charset   = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';

if(
$charset2 != $charset) {
$charset = $charset2;
}

   
$post_data = array();
   
$post_data['url'] = $tb_url;
   
$post_data['title'] = $title;
   
$post_data['excerpt'] = $title;
   
$post_data['blog_name'] = $blog_name;
   
$post_data['charset'] = $charset;

   
$url = $send_trackback;
  
if(
$send_trackback != '') {
   
$ch = curl_init();
   
curl_setopt($ch, CURLOPT_POST, 1);
   
curl_setopt($ch, CURLOPT_HEADER, 0);
   
curl_setopt($ch, CURLOPT_URL, $url);
   
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
   
$result = curl_exec($ch);

print
'<hr> Sent!';
echo(
$result);
}

?>
<form method="POST" action="trackbacktest.php">
<h2>Trackback anti-spam tester</h2>
<b>Send trackback URL</b>: <input type="text" size="40" name="sendtb" value=""><br/>
Your URL: <input type="text" size="40" name="url" value="<?php echo($tb_url);?>"><br/>
Title: <input type="text" size="30" name="title" value="<?php echo($title);?>"><br/>
Excerpt: <textarea><?php echo($excerpt);?></textarea><br/>
Blog name: <input type="text" size="15" name="blog_name" value="<?php echo($blog_name);?>"><br/>
Charset: <input type="text" size="15" name="charset2" value="<?php echo($charset);?>"> (leave default if unknown) <input type="submit" value="Post trackback">
</form>
<br />
<small>by <a href="http://www.tdscripts.com/">TD Scripts</a></small>