Page 1 of 1

Including pages and die()

Posted: Thu Aug 28, 2003 3:32 pm
by nigma
My webpage is http://www.nigmanet.net as you can probably notice I have a file called index.php that takes a GET variable called 'id'. That id represents the index of an array that has the name of the file to be included. Then here is how it goes from there:

Code: Select all

include_once('toppage.html');
include_once($arrayї$id]);
include_once('bottom.html');
Now that works fine. But what if I use die() in the page that is included second? Then bottom.html is not included. Is there an easy way around this that allows you to still include all three files?

Thanks for any help provided.

Posted: Thu Aug 28, 2003 3:43 pm
by Crashin
I suppose I'd just not use die. Instead, check to see if a condition is met before doing what you want to do. E.g.

Code: Select all

<?php
$var = blah, blah, blah;
if ($var = what you wanted) {
     do what you wanna do;
}
?>
I'm sure that's obvious. But, as far as I know die is like exit. Once it's called all further code is ignored, nay, not even read.