note 90713 added to function.exit
| From: | albert at peschar dot net | Date: | Tue, 05 May 2009 18:50:27 +0000 |
| Subject: | note 90713 added to function.exit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-154259@lists.php.net to get a copy of this message | ||
jbezorg at gmail proposed the following:
<?php
if($_SERVER['SCRIPT_FILENAME'] == __FILE__ )
header('Location: /');
?>
After sending the `Location:' header PHP _will_ continue parsing, and all code below the
header() call will still be executed. So instead use:
<?php
if($_SERVER['SCRIPT_FILENAME'] == __FILE__)
{
header('Location: /');
exit;
}
?>
----
Server IP: 83.137.20.135
Probable Submitter: 87.233.132.130
----
Manual Page -- http://www.php.net/manual/en/function.exit.php
Edit -- https://master.php.net/note/edit/90713
Del: integrated -- https://master.php.net/note/delete/90713/integrated
Del: useless -- https://master.php.net/note/delete/90713/useless
Del: bad code -- https://master.php.net/note/delete/90713/bad+code
Del: spam -- https://master.php.net/note/delete/90713/spam
Del: non-english -- https://master.php.net/note/delete/90713/non-english
Del: in docs -- https://master.php.net/note/delete/90713/in+docs
Del: other reasons-- https://master.php.net/note/delete/90713
Reject -- https://master.php.net/note/reject/90713
Search -- https://master.php.net/manage/user-notes.php