Re: php and authentication
| From: | Rasmus Lerdorf | Date: | Sat, 22 Jul 2000 15:11:19 +0000 |
| Subject: | Re: php and authentication | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1243@lists.php.net to get a copy of this message | ||
You can't use PHP's built-in HTTP authentication with the CGI version of
PHP.
-Rasmus
On Sat, 22 Jul 2000, James Brash wrote:
>
> 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
>
>