Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday November 21 2009 - 06:11:07

Cannot modify header information - headers already sent


Poster: bobbitt
Dated: Friday April 3 2009 - 2:11:37 BST

Hi all,

I'm having a *small* problem with the menu... with every page view, I now get a "Cannot modify header information - headers already sent" warning. It doesn't affect the functionality, and isn't visible to my users, but it's filling up my error log pretty quickly.

I checked but could not find any header output calls in the menu script. (However when I exclude the menu, the warnings do not appear.) Anyone know where the header output may be coming from? Does the meny read or set cookies or anything like that?


Thanks
Mike

Re: Cannot modify header information - headers already sent


Poster: pattiesgame
Dated: Friday April 3 2009 - 3:15:47 BST

can you tell me how I can write a question please? I dont have a back arrow and want to ask how to get it.

Re: Cannot modify header information - headers already sent


Poster: Ruth
Dated: Friday April 3 2009 - 4:09:08 BST

Hi,

As to the header problem, you will need to send us a link to the page so we can see what's going on. It sounds like something to do with the page, i.e. if you're using a template, or something like that.

As to the second question, I don't know what it is you want? You seemed to write this question OK. If you want to write another question on a different topic, then you would log in and post a new topic. Could you be a little clearer on what you want as to asking a question, and I have no idea what a back button would have to do with posting a topic.

Ruth

Re: Cannot modify header information - headers already sent


Poster: bobbitt
Dated: Friday April 3 2009 - 15:04:41 BST

Hi Ruth,

Thanks... the site in question is http://forums.army.ca/. The menu works fine so there's not much to see there, but in my erorrlog, every pave visit shows the "headers alraedy sent" message. Just wondering if the menu script tries to output any HTTP headers... if so I've probably already written out some HTML content, so the headers won't be sent.


Thanks
Mike

Re: Cannot modify header information - headers already sent


Poster: Ruth
Dated: Friday April 3 2009 - 18:28:27 BST

Hi,

It looks like it might be a security issue with regard to googleads. I get this message when I load a new page using the menu

Security Error: Content at
Code:
http://googleads.g.doubleclick.net/
may not load data from http://forums.army.ca/.

Now, I have to tell you this is beyond my knowledge level and I am only posting what I've found as to error and it might not have anything to do with the error log message you are getting. I am going to suggest that you file a support ticket for this since you need a level of help I cannot provide.

http://www.milonic.com/support/

When you fill the ticket, give them the same information about your error log and the link to the site. Hope you can get it figured out here.

By the way, I like that site, it really looks nice :)

Ruth

Re: Cannot modify header information - headers already sent


Poster: davebarnes
Dated: Thursday April 9 2009 - 23:22:26 BST

__at__ bobbitt,

I am not a PHP expert by any means. I think the errors that you are getting are related to something similar to:

Code:
<?php
  ob_start();  /* Start buffer so we can use header anywhere in the page  */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


If you have the ob_start, then the DOCTYPE must follow it and not precede it.

You need a PHP expert.

Re: Cannot modify header information - headers already sent


Poster: bobbitt
Dated: Friday April 10 2009 - 14:55:31 BST

Thanks Dave, that gives me an idea where to start looking! If I figure it out I'll post it here.


Cheers
Mike

Re: Cannot modify header information - headers already sent


Poster: bobbitt
Dated: Sunday May 10 2009 - 2:52:48 BST

A quick follow-up... I wish I had a solution to report, but unfortunately not yet. In fact I've been able to conclusively determine that the menu is the central to the issue. I recently discovered that my links program isn't working, for the same reason. When I click a link, I'm not redirected, and I see the familiar "PHP Notice: A session had already been started - ignoring session_start()" in my apache logs.

Here's a quick way to verify... this link should redirect you to the UN's home page:

http://milnet.ca/links/directory.php?jump=226

As you can see, it doesn't. What you can't see is that it generates the PHP notice mentioned above. If you call the same link but disable the menu*, it works:

http://milnet.ca/links/directory.php?ju ... hidemenu=1

Now that the problem has evolved into more than just log entries, I'm hoping I can resolve it. I guess my first question is, what does the PHP menu code do that writes to the HTTP header? Does it set a cookie? The code is rather obfuscated so I'm not really sure what to look for, but any assistance would be great! I think ultimately I either need to figure out a way to get the menu to write the header later in my page rendering, or leave the header "writable" for other scripts I run on the page. Has anyone seen a similar problem?


Thanks!
Mike

* Appending the 'hidemenu' variable to the URL changes just one thing: it does not include my menu's PHP script. (I'm using the PHP menu...)

Edit to add that I'm on 5.819.