note 21079 rejected from function.header by victor
| From: | victor@php.net | Date: | Wed, 28 Aug 2002 06:32:59 +0000 |
| Subject: | note 21079 rejected from function.header by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35827@lists.php.net to get a copy of this message | ||
In PHP version 4.2.0 (as opposed to 4.1.1) I noticed that my script couldn't send headers even
though I had no "echo" commands above the header().
However, I had some function calls to my own primitive functions, but they in turn did not call
"echo".
Just looking up a $_POST["var"] made it impossible to perform a header() afterwards.
The solution was to put an "@" in front of every function call and variable lookup above
the header()-call.
e.g.
if(@$_POST["submit"]) @handle_data();
header("Location: index.php");