RE: [PHP-WIN] Why I can't use header('HTTP/1.0 401 Unauthorized'); ???

From: Date: Thu, 20 Jul 2000 00:38:59 +0000
Subject: RE: [PHP-WIN] Why I can't use header('HTTP/1.0 401 Unauthorized'); ???
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-1185@lists.php.net to get a copy of this message
Coz, the fine print in...Chapter 16 says... "The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version. In an Apache module PHP script, it is possible to use the Header() function to send an "Authentication Required" message to the client browser..." Ignatius > -----Original Message----- > From: Ning Xu [mailto:nxu@webof.net] > Sent: Thursday, 20 July 2000 05:18 > To: php-windows@lists.php.net > Subject: [PHP-WIN] Why I can't use header('HTTP/1.0 401 > Unauthorized'); > ??? > > > The following is the code at the very beginning of a php3 file. > > <?php > if (!isset($PHP_AUTH_USER)) { > header('WWW-Authenticate: Basic realm="My Private Stuff"'); > header('HTTP/1.0 401 Unauthorized'); > echo 'Authorization Required.'; > exit; > } > ... ... > > Here is the error information in apache's error.log: > > [Wed Jul 19 13:58:42 2000] [error] [client 130.126.118.52] > malformed header > from script. Bad header=HTTP/1.0 401 Unauthorized: c:/php3/php.exe > > Can anybody help me about this? Thanks a lot! > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#1185) next »