as SGML comments. A command has the syntax:
<blockquote><code>
-<!--#</code><em>element attribute=value attribute=value ...</em> <code>-->
+<!--#</code><em>element attribute=value attribute=value ...</em>
+<code> -->
</code></blockquote>
The value will often be enclosed in double quotes; many commands only allow
-a single attribute-value pair.
+a single attribute-value pair. Note that the comment terminator
+(<SAMP>--></SAMP>) should be preceded by whitespace to ensure that it
+isn't considered part of an SSI token.
<p>
The allowed elements are:<p>
<dd>The value to give a variable.
</dl>
For example:
- <CODE><!--#set var="category" value="help"--></CODE>
+ <CODE><!--#set var="category" value="help" --></CODE>
<dd>Apache 1.2 and above.
</dl>
-<h2>Include variables</h2>
+<h2>Include Variables</h2>
-In addition to the variables in the standard CGI environment, these are available for the <code>echo</code> command, for <code>if</code> and <code>elif</code>, and to any program invoked by the document.
+In addition to the variables in the standard CGI environment, these are
+available for the <code>echo</code> command, for <code>if</code> and
+<code>elif</code>, and to any program invoked by the document.
<dl>
<dt>DATE_GMT
</dl>
<p>
+<H2>Variable Substitution</H2>
+<P> Variable substitution is done within quoted strings in most cases
+ where they may reasonably occur as an argument to an SSI directive.
+ This includes the
+ <SAMP>config</SAMP>,
+ <SAMP>exec</SAMP>,
+ <SAMP>flastmod</SAMP>,
+ <SAMP>fsize</SAMP>,
+ <SAMP>include</SAMP>, and
+ <SAMP>set</SAMP>
+ directives, as well as the arguments to conditional operators.
+ You can insert a literal dollar sign into the string using backslash
+ quoting:
+
+<PRE>
+ <!--#if expr="$a = \$test" -->
+</PRE>
+
+<P> If a variable reference needs to be substituted in the middle of a
+ character sequence that might otherwise be considered a valid
+ identifier in its own right, it can be disambiguated by enclosing
+ the reference in braces, <EM>à la</EM> shell substitution:
+
+<PRE>
+ <!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" -->
+</PRE>
+
+<P> This will result in the <SAMP>Zed</SAMP> variable being set to
+ "<SAMP>X_Y</SAMP>" if <SAMP>REMOTE_HOST</SAMP> is
+ "<SAMP>X</SAMP>" and <SAMP>REQUEST_METHOD</SAMP> is
+ "<SAMP>Y</SAMP>".
+
+<P> EXAMPLE: the below example will print "in foo" if the DOCUMENT_URI is
+/foo/file.html, "in bar" if it is /bar/file.html and "in neither"
+otherwise:
+<PRE>
+ <!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\"" -->
+ in foo
+ <!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\"" -->
+ in bar
+ <!--#else -->
+ in neither
+ <!--#endif -->
+</PRE>
+
<H2>Flow Control Elements</H2>
These are available in Apache 1.2 and above. The basic flow control
<DT>! <I>test_condition</I>
<DD>true if <I>test_condition</I> is false
<DT><I>test_condition1</I> && <I>test_condition2</I>
- <DD>true if both <I>test_condition1</I> and <I>test_condition2</I> are true
+ <DD>true if both <I>test_condition1</I> and
+ <I>test_condition2</I> are true
<DT><I>test_condition1</I> || <I>test_condition2</I>
- <DD>true if either <I>test_condition1</I> or <I>test_condition2</I> is true
+ <DD>true if either <I>test_condition1</I> or
+ <I>test_condition2</I> is true
</DL>
-<P> "<I>=</I>" and "<I>!=</I>" bind more tightly than "<I>&&</I>" and "<I>||</I>".
+<P> "<I>=</I>" and "<I>!=</I>" bind more tightly than "<I>&&</I>" and
+ "<I>||</I>".
"<I>!</I>" binds most tightly. Thus, the following are equivalent:
<PRE>
<I>'string1 string2'</I> results in <I>string1 string2</I>
</PRE>
-<P> Variable substitution is done within quoted strings. You can put
- a dollar sign into the string using backslash quoting:
-
-<PRE>
- <!--#if expr="$a = \$test" -->
-</PRE>
-
-<P> If a variable reference needs to be substituted in the middle of a
- string, it can be done by enclosing the reference in braces,
- <EM>á la</EM> shell substitution:
-
-<PRE>
- <!--#set var="Zed" value="${REMOTE_HOST}_${REQUEST_METHOD}" -->
-</PRE>
-
-<P> will result in the <SAMP>Zed</SAMP> variable being set to
- "<SAMP>X_Y</SAMP>" if <SAMP>REMOTE_HOST</SAMP> is
- "<SAMP>X</SAMP>" and <SAMP>REQUEST_METHOD</SAMP> is
- "<SAMP>Y</SAMP>".
-
-<P> EXAMPLE: the below example will print "in foo" if the DOCUMENT_URI is
-/foo/file.html, "in bar" if it is /bar/file.html and "in neither"
-otherwise:
-<PRE>
- <!--#if expr="\"$DOCUMENT_URI\" = \"/foo/file.html\""-->
- in foo
- <!--#elif expr="\"$DOCUMENT_URI\" = \"/bar/file.html\""-->
- in bar
- <!--#else -->
- in neither
- <!--#endif -->
-</PRE>
-
-
<hr>
<h2>Directives</h2>
<ul>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>
-