$page_id = $_GET['page_id']; // <----THIS LINE
include("$page_id"); // <----AND THIS LINE
Is a sure way to get hacked if fopen url wrappers are turned on. You may wanna rethink that. For example, you might have one big switch statement in place so you do not allow user-submitted content anywhere near an include function.
Now, here's how I do it (sometimes) at the bare minimum:
<!--header.php-->
<html><head>
<title>
<?php echo ( defined('PAGE_TITLE') ) ? PAGE_TITLE : 'Some Generic Catch-all title'; ?>
</title>
</head>
<body><div class="center">
<!--footer.php-->
</div></body>
</html>
...and then to put it all together...
<!--main.php-->
<?php
define('PAGE_TITLE', 'Cross-site scripting sucks');
include('header.php');
?>
<div id="content">
here is some content.
</div>
<?php
include('footer.php');
?>
Then again, if I were less lazy, I'd like the idea of a function call better like NogDog's example.