Re: Problem...header already sent by
| From: | Ryan F. Bayhonan | Date: | Tue, 05 Feb 2002 05:36:20 +0000 |
| Subject: | Re: Problem...header already sent by | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-83528@lists.php.net to get a copy of this message | ||
Hello Peter.
I discribe my reply below:
> **************************
> Warning: Cannot add header information - headers already sent by (output
> started at C:\apache\htdocs\proj\sports\phps\verify.php:2) in
> C:\apache\htdocs\proj\sports\phps\verify.php on line 26
> ***************************
This warning message appear when the server already send data to the client.
> 1. <html>
> 2. <?php
> ....
>
>
> 23. if (!$auth) {
> 24. header("www-Authenticate: Basic realm='Private'");
> 25. header("HTTP/1.0 401 Unauthrized");
> ...
> ?>
> </html>
In the above code, the <html></html> tag has been sent to the client browser
already, thus when calling header function it would cause a warning telling
you that data has been rendered already.
Hope this help.
Ryan