You must define an entry point, in all your pages, that will recieve all the trackback requests. The Trackback specification do it like this:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.foo.com/archive.html#foo"
dc:identifier="http://www.foo.com/archive.html#foo"
dc:title="Foo Bar"
trackback:ping="http://www.foo.com/tb.cgi/5" />
</rdf:RDF>
Where <rdf:RDF></rdf:RDF>
is where you declare that this page uses Trackbacks and the parameters inside <rdf:Description />
are specific to your page. dc:identifier
is your exact page URL and trackback:ping
is the Trackback entry point.
There is no way in JS, as a client side language, to store the trackback count for each page, so the trackback:ping
should be a PHP script that check the title
from the request query and store it somewhere (DB, file, log...)
I made this VERY simplified Trackback entry point:
<?php
$theUrl = $_GET['url'];
if (!$theUrl) {
printError(NO_URL);
die();
}
$theUrl = Sanitize::clean($theUrl, SQL) // Your anti-SQL injection method
$theId = getIdFromUrl($theUrl);
countIntoDataBase($theId);
?>
And, last but not least, is important to bear in mind that Trackback protocol is very prone to SPAM, as this answer states: Trackbacks in PHP