You are here: Re: Getting username « PHP Programming Language « IT news, forums, messages
Re: Getting username

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация