[PHP] interact with .htaccess
I want to send user and password from php to a protected directory. For example: If I go directly to the directory I get a popup to enter user and password, the normallt way. But if I go through a php-script that checks if I'm a valid user from a database I will get access to the folder. So i need a way to send user/password from php to the .htaccess file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] interact with .htaccess
Hi People That is a very good idea, i was thinking about using something similar on a file sharing area... But James, do you know how can we use this to build pages i mean include images on a html pages on a restricted way kind like Do you know how i can safely restrict file acess and still link this files into a html page, this would for example allow showing a album of photos to some users but not all site users. By the way i'm building a new personal web page and will share the code in a open source i think it would be good for newbies like me Thankx any way Miguel From: James Hicks <[EMAIL PROTECTED]> To: " Peter Berglund" <[EMAIL PROTECTED]> Date: Sun, 15 Jun 2003 10:55:33 -0400 CC: [EMAIL PROTECTED] Subject: Re: [PHP] Re: interact with .htaccess I think what you really want to do is place your downloadable files in a directory that is not in your httpd's document root and use a password protected PHP script to access these files and send them to the user after authentication. I think you could accomplish this with the fpassthru() function and the correct header. htaccess is just going to get in your way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] interact with .htaccess
At 12:28 15.06.2003, Peter Berglund said: [snip] >I want to send user and password from php to a protected directory. >For example: If I go directly to the directory I get a popup to enter user >and password, the normallt way. > >But if I go through a php-script that checks if I'm a valid user from a >database I will get access to the folder. > >So i need a way to send user/password from php to the .htaccess file. [snip] I'm afraid this is not possible for the simple reason that the _client_ needs to transmit the auth credentials to the server. What you can do however is to somehow include the page contents in your PHP output. In case the .htaccess-protected content is a simple html page you could e.g. readfile() it, or process it in a similar way. HTH, -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php