You are here: Username of currently logged on user? « PHP Language « IT news, forums, messages
Username of currently logged on user?

Posted by Simon Harris on 03/07/07 22:06

Hi All,

I am trying to get the username of the currently logged on user.

- The protected directory is /admin, within which is .htaccess as follows
AuthName "mysite.co.uk - Admin"
AuthType Basic
AuthUserFile /usr/local/psa/home/vhosts/mysite.co.uk/httpdocs/.htpasswd
require valid-user

- In the root of my site, is the .htpasswd file, containing
username/password pairs

- When I go to /admin, I am prompted for credentials. I enter these and am
allowed in

- On /admin/index.php I have tried the following:

$authUser = $_SERVER['LOGON_USER'];
and...
$authUser = $_SERVER['PHP_AUTH_USER'];

Both return an empty string/null when printed to the page

Any help would be much appreciated.

Thanks,
Simon.


--
--
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!

--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 5057 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!

 

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

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