You should only send the HTTP Authentication Header, if the user isn't already authenticated. Try something like this:
<?php $usr = "guest"; $pw = "guest"; if(!($PHP_AUTH_USER==$usr && $PHP_AUTH_PW==$pw)) { header("WWW-Authenticate: Basic realm=\"My Realm\""); header("HTTP/1.0 401 Unauthorized"); } ?> Bob "Dssopt" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi everybody, > > I try to install Apache 3.1.2 + PHP-4.1.2 on RedHat 7.2. > > All seems to be fine but when I write a PHP to test the authenticate. > <?php > header("WWW-Authenticate: Basic realm=\"My Realm\""); > ?> > Whatever I input to the login box, the failed, retry message comes out and > it becomes a dead loop - login - retry - login .. > > Can anyone help me ?? > > Ken > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php