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

Posted by Jerry Stuckle on 09/20/06 19:13

Bob wrote:
> Kim André Akerø wrote:
>
>>My bad; $_SERVER["PHP_AUTH_USER"].
>>
>>$PHP_AUTH_USER won't work unless register_globals is set to "on" in the
>>PHP configuration.
>
>
> I set register_globals ON. When I logged in and ran this script:
>
> <?php
> $auser = $_SERVER["PHP_AUTH_USER"];
> echo 'Current user is'.$auser.'<BR>';
> ?>
>
> The user was blank!!
>
> Have any idea what's wrong here?
>

First of all, you need to set register_globals to OFF. Having it on is
a potential security threat, which is why it now defaults to off.

Are you trying this from a protected directory? What happens if you put
a file containing

<?php
phpinfo();
?>

(only) in a protected directory? Do you see the authorized user there?

Also, what web server are you using?

It should show up in both $_SERVER['PHP_AUTH_USER'] (the best to use)
and $_SERVER['REMOTE_USER'] (which may or may not be authorized).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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