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]
|