The following section describes the primary Server Side Includes and their respective attributes.
config |
config errmsg|sizefmt|timefmt="string" |
Controls various aspects of SSI.
Sets the format to be used when displaying the size of the file. Valid values are bytes or abbrev, which rounds the size up to the nearest kilobyte.
Sets the format for dates and times. The full range of formats and examples are provided in Section 18.8, "Time Formats for SSI Output".
<!-- #config errmsg="Error: File not found" --> <!-- #config sizefmt="abbrev" -->
echo |
echo var="environment or set variable" |
Prints (displays in the document) the value of the variable. For an list of available variables, see Section 18.7, "Include Variables" later in this chapter.
<! -- #echo var="DATE_GMT" -- >
exec |
exec cmd|cgi="string" |
Executes an external program and inserts the output in the current document.
You are visitor number <! -- #exec cgi="/cgi-bin/counter.pl" -- > <!--#exec cmd="/bin/finger $REMOTE_USER@$REMOTE_HOST" -->
fsize |
fsize file|virtual="path" |
Inserts the file size of a specified file. The size follows the sizefmt format configuration.
Specifies the location of the file as a pathname relative to the directory of the document being parsed. This attribute is not recommended for use (it is there for backwards compatibility with old NCSA scripts).
Specifies the URL path relative to the current document being parsed. If it does not begin with a slash ( / ) it is taken to be relative to the current document.
The size of this file is <!--#fsize file="thisfile.html" -->
flastmod |
flastmod file|virtual="path" |
Inserts the last modification date of a specified file. The date follows the timefmt format configuration.
Specifies the location of the file as a pathname relative to the directory of the document being parsed. This attribute is not recommended for use (it is there for backwards compatibility with old NCSA scripts).
Specifies the URL path relative to the current document being parsed. The URL cannot contain a scheme or hostname, only a path (and optional query string). If it does not begin with a slash ( / ), it is taken to be relative to the current document.
That file was last modified on <!--#flastmod virtual="/mydocs/thatfile.html" -->
include |
include file|virtual ="path" |
Inserts the contents of another document or file into the parsed file.
Specifies a path relative to the directory of the parsed file (i.e., it cannot include ../ nor can it be an absolute path). The virtual attribute should always be used in preference to this one. This attribute is not recommended for use (it is there for backwards compatibility with old NCSA scripts).
printenv |
printenv |
Prints out a listing of all existing variables and their values.
<! -- #printenv -- >
set |
set |
Sets the value of a variable.
<!--#set var="password" value="mustard" -->
Copyright © 2002 O'Reilly & Associates. All rights reserved.