note 24884 rejected from function.include by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Wed, 04 Sep 2002 23:10:47 +0000 |
| Subject: | note 24884 rejected from function.include by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36128@lists.php.net to get a copy of this message | ||
I've recently been doing some ASP (yech) programming, and found it useful to include files with
'open ended' conditional statements. In PHP it would be:
main.php:
<? require ("foo.php"); ?>
<h1>The condition is true</h1>
<? require ("bar.php"); ?>
foo.php:
<?
if (condition == true) {
?>
bar.php:
<?
}
?>
Unless I'm doing something wrong, this seems to cause a parse error in PHP which is a bit of a
pain if you want to keep the code in main.php to a minimum.
Naich.