Warning : Cannot modify header information – headers already sent

Written By | 3 September 2009| No Comment

PHP handles lots of the work of generating web pages for you, without you even having to ask. A web page is composed of two parts, the header and the body.

phperrorThe header is generally stuff that you will provide with Location: for example header(”Location: test.php”);. This function changes the header information

Solving this problem

1) Find the header() statement that is causing the problem. The error must be at or before this line.

2) Look for any statements that could send output to the user before this header statement probably echo statement. If you find one or more, try to remove them. I have tried to move but couldn’t help, Just remove them

3) Make sure there is no white space outside of the php start and end tags. Blank line before the <?php and ?> end tag

Just follow the above steps you can eliminate this error

Share With Others

Leave your response!