Re: stop file process

From: Date: Sun, 28 Dec 2003 07:58:08 +0000
Subject: Re: stop file process
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173393@lists.php.net to get a copy of this message
Found it! Just use exit(); "Jed R. Brubaker" <jedbrubaker@hotmail.com> wrote in message news:20031228062035.97631.qmail@pb1.pair.com... > 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.

« previous php.general (#173393) next »