Welcome to the first part of three tutorials on Server Side Includes (SSI). By the end of this three part tutorial you will be able to:
- Import Text Files
- Execute CGI Scripts
- Update Your Website with ease
- And More...
"What is Server Side Includes?"
Server Side Includes is one of your best friends when it comes to updating a website. For instance, lets say your website consist of 45
pages and you got a new site sponsor and the deal was for you to include their button on every page you have.
Now, to me that would be a real pain, but with your new found friend SSI you can update every single one of your pages with no hassel at all!! Update one text file and bam you got all 45 pages updated in a matter of 2 minutes.
"What do I need?"
The biggest thing you will need is a server that will support SSI, most of them do. If you are running on Angelfire ect., you might not have that
support, so why not goto http://www.virtualave.net and sign up so you do get SSI support!
(NOTE: News Publisher works good on their servers.) Anyways, after you have a server that supports SSI the next thing you will need is
Windows Notepad or you can snag a shareware copy of CuteHTML.
After you have got both of them then read on.
"Step 1 - How to call a text file"
The most important thing about SSI is for you to learn the tags and know how they work.
The First Tag:
-
<!--#include virtual="code/nav.txt"-->
"Step 2 - The Contents of nav.txt"
Now we need to have somthing in nav.txt so we can make it show something usefull instead of a blank page! Cut and paste this code in a text file
called nav.txt and place it in a folder called "code".
-
<center>Menu Links</center>
<p>
<a href="link.htm">Link 1</a>
<br>
<a href="link2.htm">Link 2</a>
<br>
<a href="link3.htm">Link 3</a>
</p>
Next, you will need to make a .shtml page so you can call the nav.txt file. Place the following code in a file named index.shtml.
-
<HTML>
<HEAD>
<TITLE>My First SSI Page</TITLE>
</HEAD>
<BODY>
<TABLE cellpadding="1" cellspacing="1" border="0">
<TR>
<TD>
<!--#include virtual="code/nav.txt"-->
</TD>
<TD>
<CENTER>
This is my middle content area
</CENTER>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
You can see the output of this file by clicking here.
Please send any comments or ummm bugs ;) you have to me at icefire@gwscripts.com.
By IceFire
Forum Moderator, Writer
