#49728 [Opn->Fbk]: $_SERVER['PHP_AUTH_USER'] is not in header
| From: | jani@php.net | Date: | Thu, 01 Oct 2009 16:11:01 +0000 |
| Subject: | #49728 [Opn->Fbk]: $_SERVER['PHP_AUTH_USER'] is not in header | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143136@lists.php.net to get a copy of this message | ||
ID: 49728
Updated by: jani@php.net
Reported By: pliu at eiu dot edu
-Status: Open
+Status: Feedback
Bug Type: CGI related
Operating System: Windows XP
PHP Version: 5.3.0
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
There is no PHP 5.3.1 released, check your version..
Previous Comments:
------------------------------------------------------------------------
[2009-09-30 19:19:10] pliu at eiu dot edu
Description:
------------
$_SERVER['PHP_AUTH_USER'] does not pass the parameter to header. This
same problem was reported and was supposed to be fixed on version PHP
5.0. Now, it happens again with Zend Server CE (PHP 5.3.1).
Reproduce code:
---------------
<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My 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>";
}
?>
Expected result:
----------------
After entering username and password, the username and password will be
displayed on the web page.
Actual result:
--------------
In IE, the authentication window will ask 3 times for username and
password. Then, it closes, and displays "Text to send if user hits
Cancel button." In Firefox, it keeps asking for the username and
pssword.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49728&edit=1