Re: Warning: Cannot modify header information
From: Markus Ernst (derernst_at_NO#SP#AMgmx.ch)
Date: 01/14/04
- Previous message: Tony Baggadonuts: "PostNuke Ephemerids question"
- In reply to: Markansas: "Re: Warning: Cannot modify header information"
- Next in thread: Markansas: "Re: Warning: Cannot modify header information - Work Around Discovered"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 14 Jan 2004 08:51:42 +0100
"Markansas" <markansas61@yahoo.com> schrieb im Newsbeitrag
news:cdi8005hkcvplh08n40mn453941v0b2858@4ax.com...
>
> No that code was the poll.php file itself.
>
>
> I had looked into the header.php and founf that the line 6 was the
> start of a Javascript. I removed the javascript and it all works fine.
>
> If there is ANY mention of javascript in the header.php <head> tags or
> right even after the <body> the error appears.
>
> Also it don't matter WHAT the javascript code is, as long as there is
> a javascript code of some sort, the error appears.
>
> Take OUT the javacript and all works fine.
It is not because it is javascript but because you output something to the
client at all. As a cookie is a http header you have to set it before _any_
output to the client.
My suggestion is as follows:
- At the beginning of poll.php set 2 variables:
$message = "";
$displayform = 0;
- Change all echo commands from echo "something"; to $message .=
"something";
- Change all display_form(); commands to displayform = 1;
- At the position where poll.php is included now replace it by:
echo $message;
if(displayform==1) display_form();
- Include the poll.php script at the very top of the code in the main page,
or at least _before_ any <html> or <doctype> tags
Now the cookie is set before the output starts.
HTH
Markus
- Previous message: Tony Baggadonuts: "PostNuke Ephemerids question"
- In reply to: Markansas: "Re: Warning: Cannot modify header information"
- Next in thread: Markansas: "Re: Warning: Cannot modify header information - Work Around Discovered"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|