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 B

   Set 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
    <[EMAIL PROTECTED]>
  -------------------------------------


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to