note 79298 deleted from function.header by danbrown

From: Date: Sun, 07 Dec 2008 18:09:38 +0000
Subject: note 79298 deleted from function.header by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147805@lists.php.net to get a copy of this message
Note Submitter: Kevin ---- I noticed a case where IE and Firefox behave a bit differently when you're using the header function in your scripts. It took me a few hours to find it, so I hope this post saves someone else from the same agony... When using the header function, it's documented quite clearly that you can't send output to the browser before sending the headers. I found out that you can, however, send BLANK SPACES before calling the header function and get different results depending on the browser. Apparently, IE will ignore/discard blank spaces and process headers sent using the header() function. Firefox does NOT ignore blank space and as a result, it will ignore subsequent headers when you attempt to send them via the header() function. In my case, Firefox was rendering a completely blank page - except for probably my spaces :-) I found the blank spaces tucked neatly between some line breaks at the end of an include file. So if your header() calls aren't working in Firefox but they are working in IE, it's probably time to start hunting for stray space characters! Cheers, Kevin

« previous php.notes (#147805) next »