note 102527 added to function.header
benatnetsup-spa@m-portchatdotcom Fri, 18 Feb 2011 19:58:40 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
Doh! I kept getting the "headers already sent" error message on a header("Location: .....") call. I checked, re-checked, and re-checked and the scripts nor the files it included had any output - no trailing whitespace, nothing. I was stumped for quite some time and then realized I had used:
<?php
header("Something Else");
flush(); // !!!!
?>
In one of the includes. Obviously, when you flush() for the first time it must complete sending the headers, so you can't make any more header() calls!
----
Server IP: 192.41.42.26
Probable Submitter: 68.222.76.21
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/102527
Del: integrated -- https://master.php.net/note/delete/102527/integrated
Del: useless -- https://master.php.net/note/delete/102527/useless
Del: bad code -- https://master.php.net/note/delete/102527/bad+code
Del: spam -- https://master.php.net/note/delete/102527/spam
Del: non-english -- https://master.php.net/note/delete/102527/non-english
Del: in docs -- https://master.php.net/note/delete/102527/in+docs
Del: other reasons-- https://master.php.net/note/delete/102527
Reject -- https://master.php.net/note/reject/102527
Search -- https://master.php.net/manage/user-notes.php