I was looking over this article from ALA (and discussion) as a way to implement a simple template driven site, but I'm wondering if there is a better way.

I basically just need a way to include my global elements (html head, header menu/content, footer, maybe other global elements) into all the pages.

I modified the approach abit from the article. I'm checking to see if the query string is in an array called acceptable_array, and if so, it becomes $page, and then $page.php is included.

The index/template page is:

PHP Code:
error_reporting(0);
  
  
$acceptable_pages = array('home''contactus''otherpage');//typically a longer list
  
  
if (in_array($_GET['page'], $acceptable_pages)) {
      
$page $_GET['page'];
  } else if (
$_SERVER['REQUEST_URI'] == 'index.php') {
      
$page 'home';
  } else {
      
$page 'error';
  } 
  
  include_once(
"$page.php");
  include_once(
'footer.php'); 
Then, $page.php would be:

PHP Code:
$title ='Webpage title here';
  include_once(
'header.php');
   
   
//html content for $page.php 
So, is this total overkill? Is there a more recent or better approach based on best practices (besides using something like smarty or phpsavant)?

Thanks for any input.