FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.
Intro to Server Side Includes (SSI)
Posted on 06 December 2003 07:57 AM
"Server Side Includes" (SSI's) are commands that you give to your web server by placing them right inside your HTML code! An example of this is you can include a standard copyright disclaimer at the bottom of EVERY page of your website, and if you need to change it, you only have to change it once!

SSI's are very powerful. They're better than Java for the types of things they do, since not everyone can use Java - but anyone capable of downloading an HTML page will see the results of a Server Side Include!

The types of things you can do with Server Side Includes range from simple counters and "current time" displays on your page to rotating banners and the ability to show different content depending on the type of browser someone's using or where they came from.

A favorite SSI Command Line is:
<!--#include virtual="/include/test.txt" -->
What this does is place whatever you have in a file called 'test.txt' that is in a directory that you titled 'include' into your page wherever you place the line
<!--#include virtual="/include/test.txt" -->

You cannot see this by viewing the source code with your browser simply because all the work is done before your browser gets to see the page, e.g. SERVER SIDE, it's done on the server.

Imagine a website that has the same footer graphic, navigational links, and disclaimer at the bottom of every page. Let's say their copyright shows 1999 and they need to add 2000 to it. Normally this would mean having someone go through each and every page on their server to add the new year. With SSI implemented they can simply add the year in one file, test.txt for example, and it would auto update ALL of the pages!

NOTE: To use SSI within your web site on the FutureQuest® servers, you must use the extension of .shtml or .shtm rather than .html or .htm. SSI calls will not work if you do not name the file with a .shtml or .shtm extension.

Click here to see numerous examples of SSI being put to use and how you can create the code yourself.

Additional Tutorials and Resources Can Be Found By Clicking Here