Guys I would say looping include()'s is just a bad idea all together. It can get you into some gritty situations. For example it would be very easy to end in an infinte loop, or overwrite variables, or just confuse the heck out of the PHP parser. I recommend you do a header() redirect rather than include() at the end of the script. Just my opinion. - Kevin
----- Original Message ----- From: "Tim Burden" <[EMAIL PROTECTED]> To: "Beauford.2002" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, March 28, 2003 1:36 PM Subject: [PHP] Re: Include Question > You could try this instead: > > Checklogin.php > > if (!$name || !password) { > $message = $enter_info; > } > > if ($message){ > include ("login.php"); > echo $message; > exit; > } > > But the way you had it should work, you might just need to > global $message; > right before the echo in login.php in case it is inside a function > > ----- Original Message ----- > From: "Beauford.2002" <[EMAIL PROTECTED]> > Newsgroups: php.general > To: "PHP General" <[EMAIL PROTECTED]> > Sent: Thursday, March 27, 2003 3:47 PM > Subject: Include Question > > > > Hi, > > > > First, I fixed my other problem of the stack overflow by moving the files > > back to the root directory (although I would rather have them in a login > > directory). Anyway, I have a question regarding the include function. I > have > > a login script in a file called login.php - in this file it includes > > checklogin.php and loginerrors.php. If the user inputs an incorrect login > I > > assign $messages the appropriate error from loginerrors, then I re-include > > login.php where I want to show the error message, but no matter what I do > > the error message will not show up. > > > > Example. > > > > Login.php .... > > > > Enter your Name: > > Enter Your Password: > > if ($message) { echo $message; } > > > > Checklogin.php > > > > if (!$name || !password) { > > $message = $enter_info; > > include ("login.php"); > > exit; > > } > > > > Any help is appreciated. > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php