faqts : Computers : Programming : Languages : PHP : Common Problems : HTTP Headers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 10 people (70%) answered Yes
Recently 6 of 9 people (67%) answered Yes

Entry

my_file.php has 'require("include_file.inc");' & 'header("Location: http://$HTTP_HOST/next.php");', Error::can't add header info.-headers sent

Aug 13th, 2001 23:17
Jeff Hawke, Joanne Lam,


Just be sure that included file has no spaces before <?php and after ?> 
and that has no instruction that send an output, like some echo or 
print.
And remember that included files need to have their own <?php ?> tags 
at start and at end because php parser get out into html mode while 
including a file.
see include and require field on php manual.