note 56358 added to function.header

From: Date: Wed, 31 Aug 2005 15:14:44 +0000
Subject: note 56358 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-94527@lists.php.net to get a copy of this message
I forgot to mention, as a addendum to my note below, that this unusual behaviour with 4xx and 5xx codes is a good reason to always use the header() function's built in HTTP response code sender. <?php header("Location: http://www.example.com/error.php", true, 412); ?> This code will send the correct "412 Precondition Failed" header along with the "Location" header, without having to worry about header() order. ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56358 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56358&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56358&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56358&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56358&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56358&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56358&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56358&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94527) next »