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.
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:
include
include will insert the text of a document into the parsed document. This command accepts the following tag(s):
file
gives a pathname relative to the current
directory. ../ cannot be used in this pathname (this is not enforced by
the Sambar Server).
virtual
is a (%-encoded) URL relative to the
current document being parsed. The URL cannot contain a scheme or
hostname, only a path (a query string is not permitted). If
it does not begin with a slash (/) then it is taken to be relative to
the current document.
IMPORTANT! If the file does not begin with a slash (/), it is treated as a standard HTML file and sent uninterpreted.
If the file begins with a slash (/), then the included file may be any valid URL (i.e. HTML file, Sambar Server template, shtml file; or even CGI/WinCGI command). It is recommended that all include files have a leading slash (/) and avoid using relative paths.
echo
prints the value of one of the include
variables (defined below). All dates are printed in the standard
Sambar Server date format. The only valid tag to this
command is var
, whose value is the name of the variable
you wish to echo.
exec
executes a given CGI or WinCGI script.
Valid tags are:
cgi
will execute the CGI script specified by the value.
The CGI must be found in the cgi-bin directory.
wincgi
will execute the WinCGI script specified by the value.
The WinCGI must be found in the cgi-win directory.
DOCUMENT_NAME
: The current filename.
DOCUMENT_URI
: The virtual path to this document
(such as /foo/zippy.shtml).
DATE_LOCAL
: The current date, local time zone.
DATE_GMT
: Same as DATE_LOCAL but in Greenwich mean
time.
LAST_MODIFIED
: The last modification date of the
current document.
config
printenv
set
fsize
flastmod
if / else / elif
constructs