Re: HTTP AUTH. help!
| From: | ludovic | Date: | Wed, 23 Aug 2000 10:21:07 +0000 |
| Subject: | Re: HTTP AUTH. help! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13131@lists.php.net to get a copy of this message | ||
Hi,
Your problem looks come from the header function.
The function header does not work if you made output ( like echo) to your browser
before this function.
Ludovic
> Hi!
> I´ve read that http authorization with php only works if I have installed
> php as an module to apache..!?
> And I´m not quite sure if I installed it as an module, because I´m a newbie
> and only followed the instructions on a page I found.
> (http://www.devshed.com/Server_Side/Administration/Database/print.html)
>
> Well, anyways... The script I wrote looks fine, but it doesnt work! I get
> the following error:
>
> >Warning: Cannot add header information - header already sent by (output
> started at /home/httpd/htdocs/hlbtest/auth_old.php:5)
> in >home/httpd/htdocs/hlbtest/auth_old.php on line 13.
>
> >Warning: Cannot add header information - header already sent by (output
> started at /home/httpd/htdocs/hlbtest/auth_old.php:5)
> in >home/httpd/htdocs/hlbtest/auth_old.php on line 14.
>
> And the error refers to :
>
> if(!isset($PHP_AUTH_USER)) {
>
> header ('WWW-authenticate: Basic realm="HLB"'); <-- line
> 13
> header('HTTP/1.0 401 Unauthorized'); <-- line
> 14
> exit;
>
> Can this mean that i´ve not installed php as an module?
> I downloaded this file PHP-4.0.1pl2.tar.gz, from
> http://www.php.net.
>
> Or can it be that I´ll have to edit some .conf file or something?
> Hope someone can help, thanks Rikard..
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net