Forum Moderators: phranque
Wasn't too sure where to post this, but here goes anyway:
I have a selection of PHP pages that all have the same top & bottom section (there's 7 pages or so) - is there a quicker way to update these than altering them in each page individually?
Something similar to using SHTML pages with HTML?
If I've not explained what I'm after clearly, please say so, and I'll try to expand on my question.
Many thanks
The easiest way I can think of is to extract the top and bottom sections and put them in their respective files.
i.e. 'header.php' and 'footer.php'.
Then you can call them with 'require_once()' [uk2.php.net].
You'll have to go through and edit all of your pages but only once.
<edit>
BTW your pages are required to be named with a PHP extension
or
you need to tell your server to parse them as PHP
We have quite some info on that topic in the PHP section
</edit>