Posted by Kim Andr Aker on 09/20/06 17:11
Kim André Akerø wrote:
> Bob wrote:
>
> > My directory uses .htaccess authorization by requiring a username
> > and password. I want to keep a simple log of all transactions to a
> > DB which will provide the who-what-when-where for all
> > edit/add/delete operations. To this end, I want to obtain the
> > username provided in the .htaccess login. I've tried $PHP_AUTH_USER
> > and $PHP_REMOTE_USER but both variables are blank.
> >
> > How can I get the username?
>
> $_SERVER["REMOTE_USER"]
My bad; $_SERVER["PHP_AUTH_USER"].
(I'm just too used to CGI on that part, I guess.)
$PHP_AUTH_USER won't work unless register_globals is set to "on" in the
PHP configuration.
--
Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Navigation:
[Reply to this message]
|