Darkstar Posted December 26, 2007 Share Posted December 26, 2007 Let me start at the beginning. Somebody wanted me to code their website and it's a photography site so I wanted to disallow image downloads for obvious reasons. I was going to use a few tricks to accomplish this. I would overlay a transparent image over the actual image so that if somebody right clicks and hits save as they don't get the image. If they're smart enough to view source they'd see the following: <img src="nodownload.php?image=image.jpg"> nodownload.php checks to see if it's being called from in a page on a certain domain, if it is it'll use gd, grab the image and display it. If the page is being hotlinked or no HTTP_REFERER then it'll watermark the picture with GD then output it. This works fine on firefox because firefox isn't caching the output of the php page so if they right type the url of the image it runs through the script again. IE on the other hand is caching the output and displaying the picture it displayed when called from the <img> tag which defeats the purpose of having the code at all if it's going to get cached. I need a way to force all browsers to run the script (not the containing page) instead of caching it. Thoughts? If not, is there a better way or doing this other than mod_rewrite? If it comes down to it I guess I could simply use mod_rewrite to redirect to an error page. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.