ilovephp01 Posted October 5, 2009 Share Posted October 5, 2009 I want to let other sites use my images. (http://example.com/sample.jpg) but keep track of each time they use the image. So I write track.php to save the request into a DB, then return the image requested from a URL parameter (http://example.com/track.php?returnimage=sample.php) Now any of these external sites can use my image in their HTML <img src="http://example.com/track.php?returnimage=sample.jpg"> and I get my tracking. Works great. Now I want to also keep track of which URL or domain has requested an image. I thought I could use $_SERVER['HTTP_REFERER'] in track.php to see what URL it is coming from, although no luck. It doesn't look like any of the server/environment variables will return domain info I am looking for from this external site. I would like to hold off on adding an addition parameter to the request (http://example.com/track.php?returnimage=sample.jpg&externalsite=example.com) so that I can use the same code for multiple sites. Any ideas/possible? I really appreciate any help. Thank you very much! -Dustin Link to comment https://forums.phpfreaks.com/topic/176592-tracking-when-an-external-domain-uses-an-image-from-your-server/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.