Server Side Includes

Server Side Includes


SSI stands for Server Side Includes.

Some free hosting sites may provide this service, most paid hosting sites do provide it. Check the HELP or FAQ area of your host or send them a quick e-mail if they have a support line.

SSI is a Perl based coding which allows information to be gathered from the server and display (or use it) on the presented web page. It allows you to "dynamically" insert a piece of information into a web page. A couple main uses of SSI are showing the current date or displaying a common navigation on many pages (one file being displayed on many pages).

There are more advanced uses for SSI, but we are only going to be covering the basics :)

If you know your HTML coding well, at first glance this appears to be a comment area with a tag setup inside it. The SSI will see this coding and implement it. If it does not recognize the contents in the comment area (a regular commented area) then it does nothing for it. So basically SSI will only do something if it knows what it is.

An SSI command starts with the # sign. This is the indicator telling the server that this particular comment area is really an SSI feature, not a commenting area. The command, property and value are all familiar devices like any regular HTML tag.

Kinda easy so far isn't it?

SSI coding is stricter than HTML though. There are some rules you must follow for it to work correctly. Unlike JavaScript, there are no popup messages stating an error has occurred.

  1. commands and properties must be in lower case letters.
  2. double quotes are required around values.
  3. do not enter any spaces until after the command word.
  4. the # sign is required.
  5. enter a space after the value ending quote (before the ending comment tag).

That's it. Follow those rules and you should have a good working SSI page in no time.

Table of Contents