headers already sent?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

headers already sent?

Post 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
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post 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.
tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

Post 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
Post Reply