note 95975 added to function.header
| From: | phpatnano-scriptingdotde at osu1 dot php dot net | Date: | Mon, 01 Feb 2010 10:58:05 +0000 |
| Subject: | note 95975 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165547@lists.php.net to get a copy of this message | ||
Please note that the Location-Header will not exit the script! This is really important if you do
something like
<?php
if(!User::loggedin()) {
header('Location: login.php');
}
?>
This will make it harder to get access to your application, but it's still easy as the script
execution is NOT stopped. The output is still sent to the browser - use this instead:
<?php
if(!User::loggedin()) {
header('Location: login.php');
exit();
}
?>
Of course you also should replace "login.php" with an absolute path like /login.php as of
RFC 2616, see http://tools.ietf.org/html/rfc2616#page-135
----
Server IP: 212.124.37.9
Probable Submitter: 79.194.241.92
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/95975
Del: integrated -- https://master.php.net/note/delete/95975/integrated
Del: useless -- https://master.php.net/note/delete/95975/useless
Del: bad code -- https://master.php.net/note/delete/95975/bad+code
Del: spam -- https://master.php.net/note/delete/95975/spam
Del: non-english -- https://master.php.net/note/delete/95975/non-english
Del: in docs -- https://master.php.net/note/delete/95975/in+docs
Del: other reasons-- https://master.php.net/note/delete/95975
Reject -- https://master.php.net/note/reject/95975
Search -- https://master.php.net/manage/user-notes.php