Re: need better solution...

From: Date: Tue, 15 May 2001 01:42:28 +0000
Subject: Re: need better solution...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-52787@lists.php.net to get a copy of this message
> the problem is, if I terminate the script on that condition the footer > won't be displayed... Instant fix - include "footer.inc"; exit; Better fix: decide your logical layout before you proceed and arrange if/else blocks accordingly so you don't need to terminate the script to avoid showing a page's contents. ie: have your single template shell which includes a particular content container if your code allows. here's one way <? /* protect yourself from people doing things like http://your.domain/your/script?include=../../../../../../../../some/secret/file */ unset($include); // will do for the purpose of this example if ($something) $include = "this_particular_content.inc"; else if ($something_else) $include = "this_other_content.inc"; include "your_header.inc"; include $include; include "footer.inc"; ?>

« previous php.general (#52787) next »