Friday, April 06, 2007

Cannot modify header information - headers already sent

how often do you see this message?. I was furious and agitated for last two hours. I knew that I have solved this problem before, but didn't remember either the cause or the solution. Not to reinvent the wheel again, I am documenting it right now, for myself and for others.

There are many possible things that can cause this error. However, the most common thing, atleast in my case, that causes this error is having some spaces after the closing PHP tag i.e. "?>". This often occurs when you copy and paste the code. To solve it make sure there are no other characters after you PHP closing tag. Delete any trailing spaces.

Hopefully you will find this helpful.

Bookmark this blog:
Yahoo MyWeb
Google Bookmark