php and authentication

From: Date: Sat, 22 Jul 2000 07:45:18 +0000
Subject: php and authentication
Groups: php.windows 
Request: Send a blank email to php-windows+get-1241@lists.php.net to get a copy of this message
Hi, on the php site, there is an example of php using a dialogue box for username / passwords. When I run this script I get an internal server error, and Apache says the error is : [Fri Jul 21 15:14:25 2000] [error] [client 127.0.0.1] malformed header from script. Bad header=HTTP/1.0 401 Unauthorised: c:/php4/php.exe here is the header of the script I am using : if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="Whatever"'); header('HTTP/1.0 401 Unathorized'); echo 'Authorization Required'; exit; } header('HTTP/1.0 401 Unathorized'); - this is the part of the script that is giving me problems, without it the script works and displays Authorisation Required, but no dialogue box appears. Thanks if you can help me, if you cant help could you direct me somewhere where I can find the answer ? Thanks alot for you help. James

« previous php.windows (#1241) next »