note 56418 added to function.headers-sent

From: Date: Thu, 01 Sep 2005 22:31:41 +0000
Subject: note 56418 added to function.headers-sent
Groups: php.notes 
Request: Send a blank email to php-notes+get-94631@lists.php.net to get a copy of this message
To K.Tomono: Headers are not sent as soon as you call the header() function. They are only sent as soon as some body content (i.e. HTML via echo or escaping from PHP parsing mode) is reached (or, like you did, you send a flush.) Thus after calling header a few times at the beginning they are still unsent and when you call headers_sent() it knows they haven't been sent and reports so. Only when the script ends or you output from content do all the headers so far send. I think you misunderstood the way they are done and hopefully this should clear a few things up for you. ---- Manual Page -- http://www.php.net/manual/en/function.headers-sent.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56418 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56418&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56418&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56418&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56418&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56418&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56418&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56418&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94631) next »