skrlin
August 20 '03, 04:46 PM
This is building off the example transio posted here (http://www.webdesignforums.net/showthread.php?s=&threadid=5519#post68869)
First thing you need to do is make sure that your host has support for Server Side Includes (SSI)
For this to work you need 3 files.
The first being page.shtml
page.shtml from transio's example
--------------------------------------------------
<!--#Include File="header.htm"-->
Here's the content of my page
<!--#Include File="footer.htm"-->
--------------------------------------------------
How this works:
When someone requests this file in a browser (ex: http://www.site.com/page.shtml ) the server will take out the include lines and in their place it will put the files being referred to.
If the file does not exist then you will see a very generic error inserted into the code in the include line's place [an error occurred while processing this directive]
The second file being header.htm
This file gets included by page.shtml and sets up a basic layout for everything to following it.
header.htm
--------------------------------------------------
<html>
<head><title></title></head>
<body>
<table>
<tr>
<td>
<a href="home.shtml">Home</a><br>
<a href="page.shtml">Page</a><br>
<a href="page2.shtml">Page2</a><br>
<a href="page3.shtml">Page3</a><br>
</td>
<td width="100%">
--------------------------------------------------
The final file being footer.htm
footer.htm basically closes out all the tags started in header.htm but it can be used for other things that are included at the bottom of all pages of a web site (ex: copyrights, etc.)
footer.htm
--------------------------------------------------
</td>
</tr>
</table>
</body>
</html>
--------------------------------------------------
I have also uploaded an image graphically explaining how this process works. Actual files will follow in subsequent replies.
First thing you need to do is make sure that your host has support for Server Side Includes (SSI)
For this to work you need 3 files.
The first being page.shtml
page.shtml from transio's example
--------------------------------------------------
<!--#Include File="header.htm"-->
Here's the content of my page
<!--#Include File="footer.htm"-->
--------------------------------------------------
How this works:
When someone requests this file in a browser (ex: http://www.site.com/page.shtml ) the server will take out the include lines and in their place it will put the files being referred to.
If the file does not exist then you will see a very generic error inserted into the code in the include line's place [an error occurred while processing this directive]
The second file being header.htm
This file gets included by page.shtml and sets up a basic layout for everything to following it.
header.htm
--------------------------------------------------
<html>
<head><title></title></head>
<body>
<table>
<tr>
<td>
<a href="home.shtml">Home</a><br>
<a href="page.shtml">Page</a><br>
<a href="page2.shtml">Page2</a><br>
<a href="page3.shtml">Page3</a><br>
</td>
<td width="100%">
--------------------------------------------------
The final file being footer.htm
footer.htm basically closes out all the tags started in header.htm but it can be used for other things that are included at the bottom of all pages of a web site (ex: copyrights, etc.)
footer.htm
--------------------------------------------------
</td>
</tr>
</table>
</body>
</html>
--------------------------------------------------
I have also uploaded an image graphically explaining how this process works. Actual files will follow in subsequent replies.