Re: HTTP headers and include()
| From: | Zareef Ahmed | Date: | Sun, 12 Jul 2009 16:04:39 +0000 |
| Subject: | Re: HTTP headers and include() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295288@lists.php.net to get a copy of this message | ||
On Fri, Jul 10, 2009 at 12:54 PM, James Colannino <james@colannino.org>wrote:
> Eddie Drapkin wrote:
>
> > HTTP headers are sent and finalized after the first bit of output. I
> > had the same problem before and it turned out to be because I had a
> > close tag "?>" at the end of a file followed by some whitespace. The
> > solution was to remove the ?> from the end of all the files and I
> > haven't closed an entire file since. Perhaps that might be it?
>
> Hmm... In fact, I did close all my include files with the ?> tag, and
> per Michael's observation in another response, there is a line of
> whitespace after the closing tag in my include files.
>
> I tried getting rid of the trailing whitespace, and removed the closing
> tags. Unfortunately, even after that, when I place my include files
> before session_start, I get the same problem. There's no leading
> whitespace before the starting <?php tag, so I'm still a little at a loss.
>
> It's not too big of a deal though; I simply placed my include files
> after the call to session_start(). That seems to solve the problem.
>
That's a good practice, (Although not optimal is some application setups )
but I am wondering why you are not getting information about exact place
where output is being started.
You should get a "headers already sent output started at ...." kind of error
if you have enabled error reporting with display_errors ON.
>
> James
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net