[BlueOnyx:02210] Re: $SERVER['PHP_AUTH_USER'] is empty

DD bqlist at distortal.com
Wed Aug 26 10:26:01 -05 2009


Charles Bowman wrote:
> Check your version of PHP (this is a known fault in 5.0.0)
> 
> Try:
> <?php
>   if (!isset($_SERVER['PHP_AUTH_USER'])) {
>    header('WWW-Authenticate: Basic realm="My Test Realm"');
>    header('HTTP/1.0 401 Unauthorized');
>    echo 'Text to send if user hits Cancel button';
>    exit;
>   } else {
>    echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
>    echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your
>   password.</p>"; }
>> 
> 
> Try debugging the script above.
> 



Interesting - the script prompts over and over again, indicating the
variable is not being set.

PHP versions is 5.1.6


DD




More information about the Blueonyx mailing list