Re: If statement spaning files

From: Date: Sun, 16 Jul 2000 22:07:03 +0000
Subject: Re: If statement spaning files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6849@lists.php.net to get a copy of this message
This was allowed in PHP3, but is not in PHP4. Each file is parsed on its own. At 02:04 PM 7/16/00 +0200, Meir Kriheli - MKsoft wrote:
I have a several files which include header.inc at the start (after setting some vars), and footer.inc at the end of the page. I want to start an if statment at header.inc and close it at footer.inc. something like body.php ----------- <? set some vars... include ('header.inc'); ...... ...... ...... include('footer.inc') ?> header.inc ----------- <? if (condition) { ?> footer.inc ----------- <? } else {
    .......
} ?> But that gives my syntax error in header.inc. From this i guess that included files are parsed as a whole before inserting them into the page. Is this correct ? Is there another solution (require ?), or do I have to put the condition on each page (I'd hate to do this) Thank you Meir Kriheli MKsoft computer systems 'There's someone in my head but it's not me" - Pink Floyd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#6849) next »