note 21079 added to function.header

From: Date: Sat, 27 Apr 2002 20:58:58 +0000
Subject: note 21079 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-29934@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"); -- http://www.php.net/manual/en/function.header.php http://master.php.net/manage/user-notes.php?action=edit+21079 http://master.php.net/manage/user-notes.php?action=delete+21079 http://master.php.net/manage/user-notes.php?action=reject+21079

« previous php.notes (#29934) next »