Directives for SSI

Server Side Includes are invoked by embedding SSI directives in an HTML document whose type will be processed by the SSI servlet. The directives take the form of an HTML comment. The directive is replaced by the results of interpreting it before sending the page to the client. The general form of a directive is:

 

<!–#directive [parm=value] –>

 

The directives are:

config – <!–#config timefmt=”%B %Y” –> Used to set the format of dates and other items processed by SSI

 

echo – <!–#echo var=”VARIABLE_NAME” –> will be replaced by the value of the variable.

exec – Used to run commands on the host system.

include – <!–#include virtual=”file-name” –> inserts the contents

flastmod – <!–#flastmod file=”filename.shtml” –> Returns the time that a file was lost modified.

fsize – <!–#fsize file=”filename.shtml” –> Returns the size of a file.

printenv – <!–#printenv –> Returns the list of all the defined variables.

set – <!–#set var=”foo” value=”Bar” –> is used to assign a value to a user-defind variable.

  • if elif endif else – Used to create conditional sections. For example:

 

<!–#config timefmt=”%A” –>

<!–#if expr=”$DATE_LOCAL = /Monday/” –>

<p>Meeting at 10:00 on Mondays</p>

<!–#elif expr=”$DATE_LOCAL = /Friday/” –>

<p>Turn in your time card</p>

<!–#else –>

<p>Yoga class at noon.</p>

<!–#endif –>

Customizing the Admin Interface’s Look and Feel
When and Why to Use the Admin Interface

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?