Here's what I want to try. A lot of pages will need the same statements at the beginning and end, but with different "middles", like this
Code: Select all
<?php
/* complete_page.php */
/* header stuff */
SOME STATEMENT
SOME STATEMENT
if(TEST == VALUE){
CONDITIONAL THINGS
}else{
/* page specific */
PAGE STUFF
PAGE STUFF
}
/* footer stuff */
SOME STATEMENTCode: Select all
<?php
/* header.php */
SOME STATEMENT
SOME STATEMENT
if(TEST == VALUE){
CONDITIONAL THINGS
}else{
?>Code: Select all
<?php
/* footer.php */
}
SOME STATEMENT
?>Code: Select all
<?php
/* some_page.php */
include("header.php");
PAGE STUFF
PAGE STUFF
include("footer.php");
?>Code: Select all
Parse error: syntax error, unexpected $end in header.php