I'm not sure what you mean by a "master" page, but this might be the sort of thing you're looking for:
// include library files as needed
// display header
// parse get params and include the appropriate files
$page = isset($_GET['page']) ? $_GET['page'] : "";
Then, all you your site links would look like this:
That will wrap all of your pages in a standard template, and your included library can take care of such things as authentication, etc.