I asked how to prevent not logged in users from seeing certain content but the solution I chose to implement encountered a problem. I chose to make my root directory for the server C:\WAMP\www\public and to include the files I only want logged in users to see from C:\WAMP\www\private. The problem is if I have a script that needs to be interpreted by the server (such as .php) that I don't want the public but if I put them in private the server won't run them and if I put them in public then anyone can access them. Should I abandon this approach with private and public and use .htaccess instead? In the second link a suggestion was to make a file in the public directory that includes the script in the private directory but I think that's getting too messy. Any better solutions?
Come to think of it there really is three levels of security
- Content anyone can see (e.g. the registration page)
- Content only logged in users can see (e.g. the members only section)
- Content no one can see (e.g. scripts that add user accounts or make calls to the database - hold on is this even a security breach if anyone can see these sorts of things?)