In my index.php file I have only 4 include statements...
include("header.inc.php")
include("sidemenu.inc.php")
include("vars.inc.php")
include("footer.inc.php")
Now, the only one that we are interested in is the vars.inc.php. The other three stay static.
In vars.inc.php I have all of my $variables AND a massive if/else statement (I couldn't get the switch statement to work).
So, if the sidemenu $pages variable is activated to go to the Contact Us the link reads like this...
<img src="images/spacer.gif" width=3 height=5 border=0>
<P align="center"><a href="index.php?pages=contact"><font color="#ffffff" size=+1><B>Contact Us</b></font></a></p>
Notice that the href contains a passed value in the variable pages...
Now when this value is passed to the vars.inc.php script you will find...
if ($pages == "contact")
{
$title="SoftNuggets.Com";
include("contact.inc.php");
}
elseif...
...{
$title="SoftNuggets.Com";
include("body1.inc.php");
}
//End of if/else statements
This means that any value NOT found will endup displaying my body1.inc.php statement.
To see it in action go to http://www.softnuggets.com
Note that the site is still under construction so everything isn't working correctly (especially the fourm) .
The important thing is to see how quickly the text area loads and how it looks as if the static areas appear not to change at all.
I started this by creating an html page I liked and then divided it up into small files for specific portions of the page so in reality ONLY the text area changes.