What directives are available?

 
The include directive inserts the text of another document, specified either as a file or a virtual file. Path must be relative to the current document in the case of a file, or it can be a virtual path. For example:





fsize


Syntax: fsize file="path"

The fsize directive inserts the size of the file specified by path, in bytes. For example:


This file is bytes.

flastmod


Syntax: flastmod file="path"

Similar to fsize, flastmod inserts the modification date for the file specified by path. For example:


This file was last modified on .


config


Syntax: config errmsg|sizefmt|timefmt="string"

You can use the config directive to modify the default SSI behavior. The parameters are as follows:


errmsg: Sets the default error message. For example:



sizefmt: Sets the format for file size data returned by the fsize directive. The string for this parameter is either "bytes" for file sizes in bytes, or "abbrev" for file sizes rounded to the nearest kilobyte. For example:


timefmt: Sets the format for dates and times returned by the flastmod directive and the DATE_LOCAL and DATE_GMT variables.

The possible values for this parameter are as follows:













































































Format Code Description
%a Abbreviated day of the week, such as "Sun" for Sunday
%A Unabbreviated day of the week
%b Abbreviated month, such as "Jan" for January
%B Unabbreviated month
%d Two-digit, numerical day of the month, such as "01" .
%D Numerical month, day, and year, such as "01/24/97"
%e Numerical day, such as "1"
%H 24-hour clock hour, such as "17"
%I 12-hour clock hour, such as "11"
%j Numerical day of the year, such as "278"
%m Numerical month, such as "11"
%M Minutes, such as "08"
%p am or pm
%r Time, such as "08:23:17 am"
%S Seconds, such as "56"
%T 24-hour time, such as "23:54:56"
%U Week of the year, such as "47"
%w Numerical day of the week, such as "0" for Sunday and "7" for Saturday
%y Year of the current century, such as "97"
%z Abbreviated time zone, such as "PST"
skip=n Skips the next n rules in a sequence if the current rule matches
S=n Same as "skip"
env=VARIABLE:VALUE Sets the environment variable VARIABLE to the value VALUE
E=VARIABLE:VALUE Same as "env"



printenv


Syntax: printenv

This directive prints a complete list of all existing SSI variables and their values. It has no attributes. For example:


set


Syntax: set var="variable" value="value"

This directive sets the value of an environment variable. For example:

<!--#set var="country" value="United States"-->
  • 49 Users Found This Useful
Was this answer helpful?

Related Articles

Instructions using SSI

Server Side Includes - SSISSI works in conjunction with a web page usually with the .shtml...

What are Server-Side Includes?

Server-side includes (SSIs) are simple, HTML-embedded directives that instruct the web server to...

How do I use SSI?

First you must create a page with a .shtml extension! Then SSI is easily implemented into your...

What extended SSI elements are available?

flow control elements much like the ones used inprogramming languages. With flow control, you can...

What SSI environment variables available?

  DOCUMENT_NAME The filename of the current HTML document. For example: This file is...