SSI, A Little Known Design Secret

For most well-seasoned designers, Server-Side Includes (SSI) are no big secret. However, it is far from common knowledge among HTML newbies. One of the uses for SSI is "importing" the contents of an external file into your web pages. When the client makes a request for your page, that page is processed on the server, and then sent to the client machine. With SSI, the server inserts the contents of the external file into your page, before displaying it in the client browser. The best part of this is that you can alter hundreds of pages by changing the contents of one external file. This is very useful for copyright notices, page headers, and navigation areas of your web pages. The copyright notice on this page is included using a server side include. Don't over-do it with SSI, as it does increase processing time on the server, and can increase the time it takes for your pages to load. Remember to use SSI sparingly.

The copyright notice on this page is included using the following line of code:

<!--#include virtual="" -->
Remember that the file you are including should be in the same folder as the page you are including it in, or you should alter the path as needed.

If I need to update the copyright notice on all the pages on this site, I only have to alter my file. I like to use the extension .inc on my includes, just because it is easier to rememember that file is an include. You may also import ordinary text files. If your server supports ASP, you may save pages containing includes with the extension .asp. If not, you may use the extension .shtml.


The Musician's PlaceTo Shop!
Instant Gift Certificates!

© 2001-2005 Issues Magazine.
All Rights Reserved.

Get 15 FREE prints!