note 18120 added to function.exit
| From: | devinemke at devinemke dot com | Date: | Fri, 11 Jan 2002 05:38:15 +0000 |
| Subject: | note 18120 added to function.exit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24654@lists.php.net to get a copy of this message | ||
If you are using templates with numerous includes then exit() will end you script and your template
will not complete (no </table>, </body>, </html> etc...). Rather than having
complex nested conditional logic within your content, just create a "footer.php" file that
closes all of your HTML and if you want to exit out of a script just include() the footer before you
exit().
for example:
include ('header.php');
blah blah blah
if (!$mysql_connect) {
echo "unable to connect";
include ('footer.php');
exit;
}
blah blah blah
include ('footer.php');
--
http://www.php.net/manual/en/function.exit.php
http://master.php.net/manage/user-notes.php?action=edit+18120
http://master.php.net/manage/user-notes.php?action=delete+18120
http://master.php.net/manage/user-notes.php?action=reject+18120