View Full Version : Cannot modify header

03-07-2008, 07:57 AM
I have a page I'm calling headers on. I'm getting the error

PHP Warning: Cannot modify header information - headers already sent by
So i use headers_sent() to see where the issue is. It says line 1. At line 1 I only have a <?php on the line with NO white space before it. more test.. same error. I then remove everything and only have one line of code with a header(Location:http://www.blabla.com) on line 1. Again no white space before or after PHP. Still the same error.

Why is this happening? Why are my headers failing? Thanks much.

03-07-2008, 08:05 AM
Its possible your host prepends a file to the page. Can you give us a link? Perhaps tell us the EXACT error rather than just a snippet of it?

03-07-2008, 08:28 AM
If you're using UTF-8 encoding make sure you aren't saving the file with a BOM header.

03-07-2008, 08:29 AM
i have thought that the host has something going on behind the scenes.

The files are behind a secure network.

03-07-2008, 08:32 AM
dont even know what BOM header are.... researching.... nope i dont think im using them.

03-07-2008, 08:37 AM
You can't really see the BOM header. Make sure when uploading the file you are using ascii and not binary.


03-07-2008, 08:53 AM
Found the problem. Thanks to all those that helped.

Basically there was some type of invisible character in the beginning of my file. I copied all of the file but the first and last character, then pasted into a new doc. Saved over the old doc and it works!

I'm using EditPlus3 text editor in case anyone knows why this invisible char was added.

03-07-2008, 08:54 AM
That invisible character was the BOM.