note 64189 added to function.header
| From: | bkatz at usefulengineering dot com | Date: | Sun, 09 Apr 2006 10:46:53 +0000 |
| Subject: | note 64189 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107626@lists.php.net to get a copy of this message | ||
When doing a simple redirect using header, i.e.:
header("Location: login.php");
you may want to place a command to terminate your script following this, like exit:
header("Location: login.php");
exit();
Otherwise, you may find, unexpectedly, that your script following the redirect continues execution.
Not sure if this is expected behavior, but regardless, in the case of, for instance, a redirect to a
login page when a user is not logged in, that's definitely something you'll want to add to
prevent "secured" code from running.
----
Server IP: 216.194.113.175
Probable Submitter: 71.83.190.228
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/note/edit/64189
Del: integrated -- http://master.php.net/note/delete/64189/integrated
Del: useless -- http://master.php.net/note/delete/64189/useless
Del: bad code -- http://master.php.net/note/delete/64189/bad+code
Del: spam -- http://master.php.net/note/delete/64189/spam
Del: non-english -- http://master.php.net/note/delete/64189/non-english
Del: in docs -- http://master.php.net/note/delete/64189/in+docs
Del: other reasons-- http://master.php.net/note/delete/64189
Reject -- http://master.php.net/note/reject/64189
Search -- http://master.php.net/manage/user-notes.php