I have created a simple PHP web site with two areas – a public and a membership. All is well and such. Login works and the webpages are all protected from non-member users. However, I cannot seem to protect direkt access of say members-only pictures. By directly entering the full URL of a picture, I can view it in full without login in – i.e. http://www.mysite.com/members/gregs_funny_cat.jpg.
Is there a way to prohibit such access through scripting? The website is on a webhotel and I don’t have access to .httpaccess.
Put your images outside the apache-directory, if you have access to such a directory. That could be the parent directory or a subdirectory of it …
Write a PHP script to open the files from there, and send them to the browser after checking if the user is logged in.