a common (very basic) way to maintain footers/headers throughout a site :
form.php
<?php include 'header.php' ?>
<form>...</form>
<?php include 'footer.php' ?>
thankyou.php
<?php include 'header.php' ?>
<h3>thanks</h3>
<?php include 'footer.php' ?>
index.php
<?php include 'header.php' ?>
<h3>sup.</h3>
<?php include 'footer.php' ?>
Another fairly common way :
if ($action == 'about') {
include 'about.php';
// do about stuff
} elseif ($action == 'login') {
include 'login.php';
// do login stuff
} else {
echo '<h3>default</h3>';
include 'default.php';
}
Unlimited elseif checks. Using switch structure also makes some people happy. And it can eventually get much more complicated.