I have no idea how to phrase this simply, so here is the long explanation. I wanted to track the number of people who view my ads posted on craigslist. Craigslist won't let you embed PHP, javascript, or any external files in the posts, except for images. SO here is what I did:
I created a file named "hit.php" on my server. In my craigslsit post, i include:
<img src="http://myserver.com/hit.php?id=1234">
When called, hit.php records the hit in a database and then uses a header(location) to redirect to a transparent gif file. The "id" parameter in the URL is the id of the post. This has to be hard coded into each craigslist post I make.
I would instead like to pull the ID from the post URL automatically. For example, in the post http://phoenix.craigslist.com/sys/1234.html the id would be "1234". Is there a way to do this when the hit.php script is being called from an "<img>" tag?