ERROR: Cannot modify header information headers already sent by (output started at
One thing that will get ya if you aren't looking for it is an extra blank line at the end of an included file.
file1:
1: <?
2: $my_loc = $GLOBALS['DOCUMENT_ROOT'];
3: ?>
4:
file2:
1: <?
2: include("./file1.php");
3: header(" Location: /showfiles.php?location=$my_loc ");
4: ?>
This type of setup will get you because of the blank line at the end of file1 (line 4). The reason is because that empty line gets immediatly pushed to the browser, starting the output. Then some function is used that cannot be used after any output is sent to the browser. The reason some of these functions can't be used after the HTML headers have already been sent to the browser is because these functions do something to the header such as setting the location (as shown above) or setting cookies, etc.
The PHP error message should help you find where this line is.
On Fri, 14 Mar 2003 14:45:01 -0000
Quote:
> What does this error mean and how do you fix it??????
> Thanks
> Colum