Page 1 of 1

Image security

Posted: Mon Jun 19, 2006 9:20 am
by _ThndR
I've got this little question. I doubt there is a way to do it, but I wanted to ask you to be certain.

Is there a way to secure an image in such a way, that the image can only be shown when it is called by a (php) script?

If you are wondering why I would want such thing: well, I have some images that only members should be able to see. I don't want everyone to be able to see the images via anything like http://www.site.com/image.jpg.

I know this has got more to do with CHMOD than with php probably :P

I hope I'm clear in my explanation; any help would be appreciated.

Posted: Mon Jun 19, 2006 9:26 am
by tecktalkcm0391
Yes, just store the image in a location on the server that is not assessible from the internet then include it when you want it.

Posted: Mon Jun 19, 2006 9:43 am
by Ambush Commander
This can be achieved two ways: storing it outside of your webdirectory, or using htaccess to forbid all