I just started receiving a "Cannot modify header information" error. This was working yesterday, I swear. Even worse, I hadn't touched anything today but the CSS when I first saw this.
I've checked the usual things (flushing the buffer, ensuring no white space outside of the start / end tags, ensuring the site hasn't been tampered with) to no avail.
Clearly, I'm doing something really wrong here; I use my half-assed approach with other sites (other servers), so if I can learn the right way to do this, I'll update those as well, I promise.
Anyhow, the bit that causes the issue is where I modify the header:
And I call this at the very top with:Code:<?php // NOTE: the presence of any of the below lines setting header information trigger this error; // // Implicitly permit the browser to cache the page; header("Cache-Control: must-revalidate"); // Set header expiration date; $offset = 60 * 60; // SET FAR FUTURE FOR LIVE SITE $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; // Set header compact privacy policy; header("P3P: CP=\"ALL DSP COR LAW CURa ADMo DEVo TAIo PSAa PSDa IVAi IVDi CONi HISi OTPi OUR DELo SAMi IND PHY ONL UNI PUR FIN COM NAV INT DEM STA PRE LOC\", policyref=\"/w3c/p3p.xml\""); // Output header; header($ExpStr); ?>
And the initial header feed, if that helps:Code:<?php include($svr . '/inc/hdr.php'); ?>
Code:GET /sec/abt/ HTTP/1.1 Host: newsite.mydomain.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: UTF-8,* Keep-Alive: 300 Connection: keep-alive Referer: http://newsite.mydomain.com/sec/loc/ Cookie: __utma=20390567.3086974982699465000.1240592394.1240592394.1240592394.1; __utmz=20390567.1240592394.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) Cache-Control: max-age=0 HTTP/1.x 200 OK Date: Tue, 12 May 2009 20:16:48 GMT Server: Apache/1.3.41 (Unix) mod_fastcgi/2.4.6 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a X-Powered-By: PHP/4.4.9 Keep-Alive: timeout=5, max=150 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 Content-Language: en-US
Thanks!
TaliaJ





Bookmarks