SSI Test << Include >> Echo - Intro
The I of SSI stands for Include. What does this mean? Just as it sounds. It includes a specific part/code/script/feature into the current web page.

A very common use of SSI :
You have many pages that will have the same navigation area on them. Sometimes you want to change the navigation a bit but do not want to edit ALL of those pages. With SSI you can create one page for the navigation area and have all the pages link to that page. Only the one page will need to be edited for revisions.

This same feature may be applied for showing an advertisement that changes monthly. Or how about a daily greeting or update area?

Now before you go around and try to include a bunch of stuff, there is one minor drawback to SSI... You can only use files that are located on your own server directory or root. You cannot have one page on (for example) Geocities and have it include a file located on Tripod. It just won't work. It's not that powerful. Generally, this won't be a problem for most of you since you are all good people who do not transload items anyways, right??

OK... back to business...

The "include" command has two property types available. FILE and VIRTUAL. Both of these do the exact same function. FILE is used when the included file is located in the same directory (or subdirectory) as the web page calling it. VIRTUAL is used when the included file is located in a directory address starting at the server root (not in the same directory as the web page calling it).

<!--#include file="navigation.shtml" -->

<!--#include virtual="/subdirectory/navigation.shtml" -->

The first forward slash in the VIRTUAL example above tells the server to start at the root directory. It then goes up the named subdirectory and finds the specified file to include.

I've used the VIRTUAL property for files located in the same directory (instead of using FILE) and it seems to work fine, but this may come to a "try it and test it" situation to be sure. It may depend on the server setup. By default, try using FILE first.


<title>Test Page</title>
<!--#include file="Page2.shtml" -->

<table border="5">
Hello. This is a test.

Notice how the included page only requires what you want to be inserted into the calling page. You do not insert the normal HTML, HEAD, and BODY tags because they are alreayd in the main calling page. All you want to show is the "inserted" area.

The inserted area can be any coding. From plain text, a full table area, a partial table area, images, etc... Just be sure that when it gets inserted, the full page coding will all work together. Pretend you do not have SSI and put the coding into the spot... Do all the tags match up? The only tricky part happens when you are doing something with a parital table or something, but most people will either do a full table area or other object, so don't worry too much about it.

click here to view Page1.shtml

One thing about SSI includes is the process of including. It takes two separate files and creates one whole (complete) file. Click on the example and view the source code of it. Now you know from the example codes shown above there was an SSI used. The source code looks just like a regular page doesn't it? Where did the SSI command go? What the server did was actually take the SSI page and physically inserted it into the page calling it. This makes it rather hard for anyone to help you fix your SSI coding since it cannot be seen normally.
SSI Test << Include >> Echo - Intro

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads