Is there anyway to be able to tell if an image you are hosting is being viewed on another site, and if so tell which image it is and run a script when it is viewed? thanks
well, you can see my blog for an example of image hotlinking. you can stop it with .htaccess mod_rewrite
I had a look but couldnt find the article. can you give me a direct link? i am not trying to stop people hotlinking, i just want to run a php script that will update a database everytime an image is viewed on any site.
Couple of ways you could do it, are you wanting to track all images or all images from a particular location, gimme a look at an example url of an image you want to track. I would rewrite image urls to a php script, lets assume your images are in /hotlinked/ RewriteEngine On RewriteRule ^/hotlinked/(.*)$ count_my_images.php?image=$1 Code (markup): count_my_images.php = <? if( file_exists( sprintf( '/hotlinked/%s', $_GET['image'] ) ) ) { update_my_data_base( $_GET['image'] ); echo file_get_contents( sprintf( '/hotlinked/%s', $_GET['image'] ) ); } else { echo file_get_contents( '/hotlinked/404.image.jpg' ); } PHP: That code prolly won't actually work for you, is an example, gimme some more details and I'll write something that does.....