note 95975 deleted from function.header by danbrown
| From: | danbrown@php.net | Date: | Mon, 01 Feb 2010 15:23:43 +0000 |
| Subject: | note 95975 deleted from function.header by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165564@lists.php.net to get a copy of this message | ||
Note Submitter: php at nano-scripting dot de
----
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