I would like to have code for an image that counts the number of times the image is viewed, regardless of what site the image is found on. I want to use the img src tag, and hav
Yes you're on a good start. I'd do something like this
In image_counter.php, take $src = $_GET['src'] for image source.
$src = $_GET['src']
Then +1 the hit for that image in the database.
Then do
header('Content-type: image/jpeg'); readfile($src);