13.2 Basic SSI Directives All SSI directives have the format: <!--# command parameter =" value " ... --> Each of the symbols is important; be careful not to forget the pound sign (#) or the dual dashes (--). Also, it is recommended that you place whitespace between the final arguments and the closing dashes to prevent it from being interpreted as part of an SSI argument. Following is a list of the primary server-side directives, the parameters they take, and their function.
config errmsgsizefmttimefmt=" string " Modifies various aspects of SSI. Arguments
echo encoding=" type " var=" environment_variable " Inserts value of special SSI variables, as well as other CGI environment variables . For example: <H1>Welcome to my server at <!--#echo var="SERVER_NAME" -->...</H1> Arguments
exec cmdcgi=" string " Executes external programs and inserts output in the current document. Arguments
For example: <!--#exec cmd="/bin/finger $REMOTE_USER@$REMOTE_HOST"--> This page has been accessed <!--#exec cgi="/cgi-bin/counter.pl"--> times.
flastmod file=" path " Inserts the last modification date and time for a specified file. The file was last modified on <!--#flastmod file="/mybook.ps"-->. You can specify the format of the date and time returned using the config directive with the timefmt argument; timefmt takes a wide range of values described in Section 13.4 later in this chapter.
fsize filevirtual=" path " Inserts the size of a specified file. Arguments
For example: The size of the file is <!--#fsize file="/mybook.ps"--> bytes. <!--#fsize virtual="/personal/mydata.txt"-->
include filevirtual=" path " Inserts text of document into current file. Arguments
For example: <!--#include file="stuff.html" --> <!--#include virtual="/personal/stuff.html"-->
printenv Prints all environment variables on the server. For example: <!--#printenv-->
set var=" name " value=" value " Sets a server-side variable to a given value. Arguments
For example: <!--#set name="myvar" value="activated"--> |
Team-Fly |
Top |