have been working on a complex website that has a lot of pages. I recently had someone who is a very knowledgeable programmer ask me why I wasn’t using server side includes for a fairly complex menu structure. I thought about it and all I could say was, I don’t know. Later, as I thought about it, I realized that the reason I wasn’t using server side includes was because the color coding of the menu changed when the page was changed to indicate the current page. Nothing else on the page was static across the site other than the banner and background. I could use server side includes for this, but it isn’t a high priority for this site.
Note: SSI is only usable in shtml, ASP, and PHP pages
To use SSI the steps are fairly basic:
Create a .html, .asp, or .php file that includes the reusable code. (For security use .asp or .php if there is sensitive information)
Add your include code into your file where it goes to read correctly. The syntax is:
shtml & ASP: <!–#include virtual=”/path_relative_to_site” –>
PHP: <?php include(“../path_relative_to_document”) ?>
Tags: server side includes, ssi