bltesar Posted July 28, 2006 Share Posted July 28, 2006 My server administration allows me to password protect files and folders. When attempts are made to access the protected files, a dialogue window opens requesting username and password. Can anyone tell me if it is possible, using PHP, to gain access to these protected files without the dialogue window opening? Quote Link to comment https://forums.phpfreaks.com/topic/15875-using-php-to-authenticate-password-protected-filesfolders/ Share on other sites More sharing options...
wildteen88 Posted July 28, 2006 Share Posted July 28, 2006 You can access these files with PHPs file functions, by using file_get_contents, or if they are php scripts use include/require. PHP doesnt send requests through the server to access the files, but the OS, so it wont trigger the authentication dialog box. Quote Link to comment https://forums.phpfreaks.com/topic/15875-using-php-to-authenticate-password-protected-filesfolders/#findComment-65111 Share on other sites More sharing options...
bltesar Posted July 28, 2006 Author Share Posted July 28, 2006 Perhaps it would help if I gave a particular example. I have a folder that holds images, and access to that folder requires authentication. When I create a page that contains images from this folder and I access the page, a pop-up validataion box opens up. Rather than assign a username/password via server admin for each user, I want to have only one username/password and I'm wondering if there is a way to submit this username/password behind the scenes with PHP.The reason for this is that I want users to gain access by registering and creating their own username password and all the validation to be done using PHP/MySQL, but I also want server level authentication to block the images from the general public. Quote Link to comment https://forums.phpfreaks.com/topic/15875-using-php-to-authenticate-password-protected-filesfolders/#findComment-65177 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.