Re: .htaccess question
| From: | Brian S. Dunworth | Date: | Thu, 22 Mar 2001 18:07:20 +0000 |
| Subject: | Re: .htaccess question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45155@lists.php.net to get a copy of this message | ||
At 06:57 PM 3/22/01 +0100, Jimmy Bäckström wrote:
Yo! I need to know how I create a login script that uses the htaccess file to authenticate users. Thankful for any answers! /Broder BSet up your .htaccess file as usual, pointing to a userfile created with htpasswd. Place the .htaccess file in the directory with your PHP script(s), and users will be automatically prompted for username/password before being served any file in that directory (at least the first time during that session, anyway). Within your PHP script(s), you can determine the user by reading the REMOTE_USER http environment variable: $user = getenv("REMOTE_USER"); - Brian ------------------------------------- Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 <brian@theprintinghouse.com> -------------------------------------