How bout something like this:
------ header.php --------
<?php
if (!$title) {
$title = "the default page title";
}
?>
<html>
<head>
<title><?php print ($title); ?></title>
</head>
<body>
----- end header.php ---------
------- pagename.php -------
<?php
ob_start();
$mytitle = "this is the pages title";
$keywords = "this is the pages meta keywords";
print ("this is mypage content");
$contents = ob_get_contents();
ob_end_clean()
include ("header.php");
print ($contents);
include ("footer.php");
?>
------ end pagename.php --------