PHP and SSI Including
Tired of having to update all your pages everytime you make a navigation or layout change? Luckily, there's a quicker way, as long as your host supports PHP or SSI. Most free hosts don't, but Freewebs/ supports SSI, which is shown at the end of this tutorial.

Step One: Dividing your content

(note: I recommend making a new folder for all these files. It will make things easier.)
First, we'll use a basic HTML template to practice with. In this tutorial, we are going to devide the HTML into 3 parts: Header, content, and footer. Copy and paste this code into Notepad:

<title>TITLE HERE</title>


I want this to be included...

yay I love HTML!

I want this to be included too...


Cut all the coding in red, open a new Notepad file, and paste in it. Save it as "header.php".
Cut all the coding in green, open a new Notepad file, and paste it in. Save it as "footer.php".
Leave all the coding in blue in the original Notepad file, and save it as "index.php" or any other name.

Step Two: The Magic of PHP!

Open "index.php" or whatever you called it. At the VERY top of the code, add this:
<? include ('header.php') ?>

At the VERY bottom of the code, add this:
<? include ('footer.php') ?>

Upload index.php, header.php and footer.php to your server. Go to or wherever the index.php is located, and the header and footer should be there. If they are, congratulations! You've managed to use PHP Includes!

Server Side Include

If your host does not support PHP, hopefully, it supports SSI. SSI stands for Server Side Include, and is exactly the same thing as PHP Includes, only the code you use is different. (obviously) To include the headers and footers, you'll have to use this coding, and rename all your pages to pagename.shtml:
<!--#include virtual="header.html"-->
<!--#include virtual="footer.html"-->