In article <325cgoF3j1kjlU1@individual.net>,
"Fabian" <lajzar@hotmail.com> wrote:
[color=blue]
> // start code snipet
> $user= "username";
> $pass= "password";
>
> if (( $PHP_AUTH_USER != $user) || ( $PHP_AUTH_PW != $pass)) {
> header("WWW-Authenticate: Basic realm=\"PhpWiki\"");
> header("HTTP/1.0 401 Unauthorized");
> echo "You entered an invalid login or password.<BR>";
> echo "You entered $PHP_AUTH_USER for a username.<BR>";
> echo "You entered $PHP_AUTH_PW for a password.<BR>";
> exit;
> }
> echo "You entered $PHP_AUTH_USER for a username.<BR>";
> echo "You entered $PHP_AUTH_PW for a password.<BR>";
> // end code snipet
>
> This code invariably fails, and the echo statements return blank values
> for $PHP_AUTH_USER and $PHP_AUTH_PW. Aren't those two set automatically
> when the dialogue box pops up, or do I need to add extra code somewhere
> for this to work?[/color]
No. $PHP_AUTH_USER and $PHP_AUTH_PW aren't defined on my server. What
are they? I don't find reference to them in any of my books or the php
manual site. Where are you reading that these are valid?
http://us2.php.net/manual/en/features.http-auth.php
--
DeeDee, don't press that button! DeeDee! NO! Dee...