Miles LLC Posted August 22, 2011 Share Posted August 22, 2011 Ok, I have a GD image that is then rewrote as a png. My question is, is it possible to find out what site is requesting the image and then use it on the php image. Example, if I didn't want a domain to use my images, could I somehow me able to restirict that site? Link to comment https://forums.phpfreaks.com/topic/245396-gd-images/ Share on other sites More sharing options...
jcbones Posted August 22, 2011 Share Posted August 22, 2011 Yes, you can restrict anything using an IP address from getting your images. Scroll down to "blocking bandwidth leeches" To find the bandwidth leeches, look at your server logs to see which sites are hitting your images. Link to comment https://forums.phpfreaks.com/topic/245396-gd-images/#findComment-1260360 Share on other sites More sharing options...
Miles LLC Posted August 22, 2011 Author Share Posted August 22, 2011 That was just an example, I am also wanting to only allow certain domains to images. Lol Link to comment https://forums.phpfreaks.com/topic/245396-gd-images/#findComment-1260367 Share on other sites More sharing options...
teynon Posted August 22, 2011 Share Posted August 22, 2011 You can whitelist or blacklist. I'd have to test this to be sure, but you could look at the referrer in the image PHP file. When it is generated, if the $_SERVER['HTTP_REFERER']; domain is in the domain list, add the domain text to the image. If not, die(). Link to comment https://forums.phpfreaks.com/topic/245396-gd-images/#findComment-1260372 Share on other sites More sharing options...
jcbones Posted August 22, 2011 Share Posted August 22, 2011 .htaccess is very powerful, you can allow or deny any domain you wish to, to whatever folder you wish. Link to comment https://forums.phpfreaks.com/topic/245396-gd-images/#findComment-1260680 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.