Here's how I do it:
Assume that I have 50 pages on my site (About Us, Contact Us, Fees, Products, Information, etc).
Every page gets a number.
Every page has the following code at the top of the page:
<?php
$page = ##; // Where ## is the code for the current page
include("header.php");
?>
Then, inside header.php, I read from the database to get the metatags and keywords for that particular page and print them into the HTML. This way, I can make an Admin page for editing each page's keywords so that when I turn the site over to my client, they can manage this stuff themselves without having to know HTML and without having to call me.
Giving each page it's own code number (and specifying it at the top) has a nice side effect: I can make header.php appear customized for certain pages. For example, if the client wanted me to make the header displayed in the color red on page 26, I can include a line in header.php that says:
if ($page==26) { print "bgcolor=red"; }
and other little customizations like that.