I am looking for best practice tips for dividing site content into logical blocks. I want the header and footer to be constant throughout the site, so if I have several pages with different content, they will all look like below - changes made in the header and footer, and then automatically update without me, to change each individual page.
<?php
include 'header.php';
?>
<body>
<p>page content here</p>
</body>
<?
include 'footer.php';
?>
header.phpIt will contain an opening <html>, <head>and the static content, and footer.phpwill contain a further static content, and a closing tag </html>. So my question is: is this a good approach? I worry that tagging <html>across multiple files is bad practice. If so, what is the right approach to such a design?
source
share