Restricting file types/folders?
Posted: Thu Oct 20, 2005 6:27 pm
Hey,
I am in the process of setting up a login system in PHP. I would prefer that this system be setup in PHP rather than simply creating a .htaccess/pw file(s) because of the flexibility of PHP. I also plan on integrating many features, so in a sense PHP is necessary. I also plan on using the database for other applications.
My question is this . . .
How can I restrict access to certain folders that can only be viewed when the user has been logged in via the PHP login system?
For instance, lets say I have several protoype logos for a company that I only want to be visible by that company. Lets say the login redirects you to /client.php, where the logos are displayed. The images are located in the /images/clients/ folder. Is it possible for me to have these images only be displayed if the user has logged in? I am trying to avoid the possibility of one giving out a direct link to the files, so rather than logging in to view them, one could simply type the full URL and go directly to the images.
I hope I have made myself clear, and I thank you in advance
I am in the process of setting up a login system in PHP. I would prefer that this system be setup in PHP rather than simply creating a .htaccess/pw file(s) because of the flexibility of PHP. I also plan on integrating many features, so in a sense PHP is necessary. I also plan on using the database for other applications.
My question is this . . .
How can I restrict access to certain folders that can only be viewed when the user has been logged in via the PHP login system?
For instance, lets say I have several protoype logos for a company that I only want to be visible by that company. Lets say the login redirects you to /client.php, where the logos are displayed. The images are located in the /images/clients/ folder. Is it possible for me to have these images only be displayed if the user has logged in? I am trying to avoid the possibility of one giving out a direct link to the files, so rather than logging in to view them, one could simply type the full URL and go directly to the images.
I hope I have made myself clear, and I thank you in advance