Sambar Server Documentation

Server-side Includes


The Sambar Server Server Side include implementation is based on the Apache implementation. Server-side includes allow you to embed commands in an HTML file that are carried out when the document is served to a browser. This functionality is also available using the proprietary Sambar Server tags, which perform considerably than faster, but are non-portable.

Using Server-side includes you can offer dynamically generated data such as the current date or time, include the output of a CGI script in a Web page, or signature files that are appended or prepended to all of your Web pages. All this comes with the cost of additional processing on the server to parse for the SSI directives within the HTML file. For this reason, you must configure the Sambar Server with the file extension that should be processed for Server-side includes; by default, the SSI files must have the extension .shtml. See the Configuration documentation for additional details on configuring or disallowing SSIs.

Server-side includes (SSI) can be configured so that users can execute arbitrary programs on the server (see the #exec command). The Sambar Server allows you to disable the #exec functionality from SSIs or disable SSI functionality all-together by removing the shtml entry from the Server Side Includes = line in the config.ini. This

Warning! Additional SSI extensions can be configured in the config.ini file, but the extension .stm should NOT added as an SSI extension; the .stm extension should only be used for Sambar Server scripting (required for the System administration pages).

SSI Overview

SSIs appear in HTML documents within comment tags, beginning with <!-- and end with -->. The following is the basic format:

where #command is the include command to be executed (see below for a list of supported commands). The following illustrates how to display when the current document was last modified:

Supported Commands

The following is a list of commands and their associated tags:

By default the PATH_INFO and QUERY_STRING of the original request are passed to the cgi/wincgi executable. The specification requires that all parameters to be passed to the CGI script be passed as arguments to the server-side include URL request. The Sambar Server extends this functionality, allowing parameter arguments to be provided to the CGI in the server-side include (see below). Any arguments provided for the CGI will be passed in the QUERY_STRING, over-riding the arguments passed to the original URL.

SSI Environment Variables

The following is a list of variables that are made available to parsed documents (most CGI variables, are also made available):

Unsupported SSI Commands

The following SSI commands are not supported by the Sambar Server at this time:

Extending SSI Commands

Server-side include commands may be extended using the Sambar Server DLL interface (sa_cmd_init). See the sample programs included with the Sambar Server for more information.

© 1998 Sambar Technologies. All rights reserved. Terms of Use.