Another option if you have a lot of pages: you can create the basic layout page (the header and the footer) and replace the body content with this code:
PHP Code:
if($_GET['page'] == "") {
include("includes/main.php");
} else if (!file_exists("includes/".$_GET['page'].".php")) {
echo "Page not found.";
} else {
include("includes/".$_GET['page'].".php");
}
This code just checks that a body content file exists and then loads it. Navigation is done by
index.php?page=home. If no extenstion is given, then it loads
main.php.
It's simple and I've seen a lot of websites use this method.