Just create your own tiny framework
A very simple version of your request would be something like this:
<?php
$templateLocation = $_SERVER['DOCUMENT_ROOT'].'/templates';
$defaultPage = 'home';
// Open your page with the frame, the footer , header etc
$template = file_get_contents($templateLocation.'/main_template.html');
// Get the page from the url, or use a default
$page = isset($_GET['page']) ? $_GET['page'] : $defaultPage;
// Check if the page exists:
if( !file_exists($templateLocation.'/pages/'.$page.'.html') ){
// if it doest exist, go to the homepage (and tell bots 404, page not existing):
header("Location: /".$defaultPage, true, 404);
exit;
}
else{
// Get the content of the requested page
$pageContent = file_get_contents($templateLocation.'/pages/'.$page.'.html');
// Place it in our main page
$template = str_replace("<!-- CONTENT -->", $pageContent, $template);
// Put it on the screen:
echo $template;
}
Matching html example for main_template.html
:
<html>
<body>
<header> <img src="my-logo.jpg" alt="Logo"/> </header>
<div id="PageContent"><!-- CONTENT --></div>
<footer> Some neat information right here</footer>
</body>
</html>
You can now link to your pages with ?page=example
or ?page=puppies
and the code above will check if the page exists, is so -> load it.
Now we have a simple framework for switching pages, but SEO-wise it's terrible. No titles, no meta's. Let's fix that!
Let's add a little SEO to the mix
At this point it's a bit more difficult to help you with an answer. I'm going to base my answer on the fact that you have or can learn basic mysql functionallity. This could be done with more templates, but you want to save time, let's do it right the first time.
Just create a database table with the columns id,url,title,description
<?php
$sPageInfo = mysqli_query("SELECT * FROM pages WHERE url='".$page."' LIMIT 1");
$fPageInfo = $sPageInfo->fetch_assoc(); // fetch the selected values
$template = str_replace("<!-- SEO_TITLE -->", $fPageInfo['title'], $template);
$template = str_replace("<!-- SEO_DESCRIPTION -->", $fPageInfo['description'], $template);
Just place that piece of code above your echo $template;
and add the corresponding comments to your template.
Note: The query is MEGA unsafe, read up on mysql injections to improve this. That is a must! My example is easier to read like this, but you REALLY should implement it.
Note 2: If you're feeling brave, expand your database with a column called 'content' and load that instead of a template ;)