Re: trapping the user name from .htaccess / .htpasswd

From: Date: Thu, 07 Mar 2002 18:53:14 +0000
Subject: Re: trapping the user name from .htaccess / .htpasswd
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-87664@lists.php.net to get a copy of this message
EXCELLANT! I have found that $username = $_SERVER['REMOTE_USER']; does exactly what I need it to do. Now, final question is how do I program a "LOGOUT" button, so when clicked the person will "lose" their identity and I can bounce them to a "non-secure" page. Any ideas? Dave "Jason Wong" <php-general@gremlins.com.hk> wrote in message news:php.general-87645@news.php.net... > On Friday 08 March 2002 00:36, Dave wrote: > > Hello all, > > > > I have an .htaccess and .htpasswd file in a directory. This is working > > fine, when anyone attempts to enter this directory, they are prompted for a > > user name and password, and if correctly entered, the page will load fine. > > > > What I would like is the ability to capture, or trap the user name. > > > > Immagine, in the simplist example, when the form loads, I could have > > > > <? > > print "Hello".$username; > > ?> > > > > Assuming $username was the varable for the user who logged in. > > Use $PHP_AUTH_USER & $PHP_AUTH_PW. > > Read the manual chapter "HTTP authentication with PHP". > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > /* > My idea of roughing it is turning the air conditioner too low. > */

« previous php.general (#87664) next »