Server Side Include
  1. Introduction

  2. What is SSI?

  3. Using SSI

  4. SSI Commands

  5. Additional SSI Variables

  6. SSI Sample Commands

  7. Enabling SSI

  8. REFERENCES


Using SSI

Normal HTML files end with an extension of ".HTM" or ".HTML". An SSI file is simply an HTML file that may include SSI statements. The server identifies these types of files by the file name extension ".SHTML". When the server is sending a file to the client with this extension, it searches for SSI statements in the file before sending it. Therefore to use SSI, rename the HTML file that will contain the statements into an ".SHTML" file. Do this sparingly though. A URL with the .SHTML exten sion will automatically invoke the server to search of SSI statements thereby adding to the server's load. Hence, files should only be labeled with the .SHTML extension ONLY when you intend to include SSI statements in them.

To use SSI statements, the following must be included on the HTML page.

<!--#exec cgi="/cgi-bin/hits.pl"-->

SSI Commands are specified using the following syntax:

<!--#COMMAND PARAMETER="ARGUMENT"-->

The <!-- and the --> brackets must be included.


TIPS

What if I have hundreds of html pages. Do I have to rename every one of them with an SHTML extension?

To work around this problem, make a .htaccess file in your root directory, add only this to the first line:
AddType text/x-server-parsed-html .html
That will make the server scour all html pages looking for SSI commands. Although, this won't work with everything as some CGI's tend to mess up, but it should work 80% of the time.

BACK TO TOP

PREVNEXT

BACK
BACK


 
©Copyright 2003 - WebFreebie.com free web hosting and domain registration