Page 1 of 1

headers already sent?

Posted: Sun Dec 21, 2003 5:57 pm
by tecton
ok, i have a simple guest book that once it logs the info into the DB, it returns to the main guest book page...

here is the specific code

Code: Select all

// Takes us back to the entries
    $ref = $_SERVERї'HTTP_REFERER'];
    header ("Location: $ref");
here is the error
Warning: Cannot modify header information - headers already sent by (output started at chiller/main.php:5) in chiller/bin/book.inc on line 78

the guestbook is stored within a file called book.inc and called from main.php

Posted: Sun Dec 21, 2003 6:03 pm
by qads
on line 5, in main.php you are outputing something, could be html or just a empty line, check out viewtopic.php?t=1157.

Posted: Sun Dec 21, 2003 6:20 pm
by tecton
hmmm
checked into this...and put the ob_start and ob_end_flush but its still doing it
line 5 of main.php is just the style sheet...

is there any other way of making PHP tell the broswer to go to a page?
the entire guestbook is contained within one page, so i cant use a meta-redirect