newb: stop file process
| From: | Jed R. Brubaker | Date: | Sun, 28 Dec 2003 06:23:20 +0000 |
| Subject: | newb: stop file process | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173392@lists.php.net to get a copy of this message | ||
This one should be simple.
I am wondering if there is a simple way in which to stop the processing of a
file.
The current example is a program that checks to see if the user is logged
in. In the past I have done something like this:
if ($loggedIn != true) {
echo "You are not logged in.";
}
else {
echo "Welcome";
}
This, however, becomes a substantial problem (or at least annoyance) when
the else is pages long. I would prefer to have something like:
if ($loggedIn != true) {
echo "You're not logged in.";
// stop process of file here
}
// Page content (with no else)
The ultimate objective is to have a simple function in the my class include
file to verify that the user is always logged in.
Thanks in advance.