Suppose user A has some images in his/her account in Facebook which s/he can view after log-in.
If user A logs out and the url of one of those images is tried, 'access restriction '-type message appears.
Think of a social networking site built in PHP.
How to achieve that kind of control so that NO images can be viewed without logging in to the site JUST as Facebook does?
header()
http://il2.php.net/manual/en/function.header.php (image/png for example)readfile()
http://php.net/manual/en/function.readfile.php.md5()
http://il2.php.net/manual/en/function.md5.php to generate the hash but remember to name the image files according to their md5 hashes, in this case you always lookup the image file only in the images directory).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With