hi. i'm working on a site right now that generates pages in a similar way to what you seem to be looking for.
i'm using phpMyAdmin, a great app, for mysql db administration. i have tables in my database that store one page on each row in the database. i have different columns for all the info that might change (meta tags, content, etc.), and use a URL system similar to what you were describing (www.website.com/index.php3?page=foobar)
i use a single .html file as a'face' for the site, and use a simple .php3 script to generate all the pages. it's verrrrry simple, but it works wonders.
i learned almost everything on how to make use of templates from a great article on this site, 'Templates, the PHPLIB Way'.
the URL for that is:
http://www.phpbuilder.com/columns/david20000512.php3
check it out, it's very helpful. if you have any specific quesitons one you read the article, feel free to check back here for help.
good luck!
-dolphinsnot