I'm looking for advice on the best practice for separating site content up into logical blocks. I want a header and footer that are constant throughout the site, so that if I have several pages of different content, they will all look as below — changes made to the header and footer then update automatically without me having to change each individual page.
<?php include 'header.php'; ?> <body> <p>page content here</p> </body> <? include 'footer.php'; ?>
header.php would contain the opening
<head> and static content, and the
footer.php would contain any extra static content and the closing
</html> tag. So, my question is: Is this a good approach? I'm worried that spreading the
<html> tags across multiple files is bad practice. If so, what is the right way to approach this kind of design?