Sections that will be covered in the exam have headings that look like this.
<!--#echo var="LAST_MODIFIED"-->
<!--#echo var="DOCUMENT_NAME"-->
<!--#echo var="DOCUMENT_URI"-->
<!--#echo var="DATE_GMT"-->
<!--#echo var="DATE_LOCAL"-->
<!--#echo var="HTTP_USER_AGENT"-->
<!--#echo var="HTTP_HOST"-->
<!--#echo var="SERVER_NAME"-->
<!--#echo var="HTTP_ACCEPT"-->
<!--#echo
var="HTTP_ACCEPT_LANGUAGE"-->
It is possible to create a local variable inside a file that uses SSI commands.
<!--#set var="fiu" value="www.fiu.edu" -->
<!--#echo var="fiu" -->
For a list of the time formatting codes, visit this site: http://internetconnection.net/support/tech-ssitime.html
Change the last modified date to m/d/y, the decimal number day of the year,
and am/pm
<!--#config timefmt="%A %D (day %j) at %r" -->
Change the file size to bytes
<!--#config sizefmt="bytes" -->
Include the output of a cgi script.
The cgi parameter is relative to the document root of the server.
<!--#exec cgi="/~downeyt/cgi-bin/test.cgi" -->
Hello from test.cgi
<!--#exec cmd="/netdepot/J2SE-1.6/bin/java -cp /home/bear-008/users/downeyt/public/server/data/java SayHello" -->
Including the output of a Unix command.
The cmd parameter is an absolute file system path.
<!--#exec cmd="/usr/bin/date"-->
SSILegacyExprParser on
.
It is possible to use an if statment with SSI files. The conditional directives are if, elif, else, endif. It is also possible to do pattern matching using /pattern/. Here is an example that tests if this file was last modified on a weekday
<!--#if expr="${LAST_MODIFIED} = /Sat/" --> <p>Not modified on a weekday; modified on Saturday <!--#elif expr="${LAST_MODIFIED} = /Sun/" --> <p>Not modified on a weekday; modified on Sunday <!--#else --> <p>Modified on a weekday <!--#endif -->
Modified on a weekday
<!--#if expr="${LAST_MODIFIED} = /Sat/" --> <!--#set var="LAST_MODIFIED" value="Monday" --> <!--#elif expr="${LAST_MODIFIED} = /Sun/" --> <!--#set var="LAST_MODIFIED" value="Monday" --> <!--#else --> <!--#set var="LAST_MODIFIED" value="Sunday" --> <!--#endif -->
<!--#if expr="${LAST_MODIFIED} = /Sat/" --> <p>Not modified on a weekday; modified on Saturday <!--#elif expr="${LAST_MODIFIED} = /Sun/" --> <p>Not modified on a weekday; modified on Sunday <!--#else --> <p>Modified on a weekday <!--#endif -->
Not modified on a weekday; modified on Sunday
<!--#printenv -->
UNIQUE_ID=Z0TVcS@9OTXVErXw17yyYAAAAIE SCRIPT_URL=/~downeyt/cgs4825/ssi.shtml SCRIPT_URI=https://users.cs.fiu.edu/~downeyt/cgs4825/ssi.shtml HTTPS=on SSL_TLS_SNI=users.cs.fiu.edu SSL_SERVER_S_DN_CN=*.cs.fiu.edu SSL_SERVER_I_DN_C=US SSL_SERVER_I_DN_ST=Arizona SSL_SERVER_I_DN_L=Scottsdale SSL_SERVER_I_DN_O=GoDaddy.com, Inc. SSL_SERVER_I_DN_OU=http://certs.godaddy.com/repository/ SSL_SERVER_I_DN_CN=Go Daddy Secure Certificate Authority - G2 SSL_SERVER_SAN_DNS_0=*.cs.fiu.edu SSL_SERVER_SAN_DNS_1=cs.fiu.edu SSL_VERSION_INTERFACE=mod_ssl/2.4.37 SSL_VERSION_LIBRARY=OpenSSL/1.1.1k SSL_PROTOCOL=TLSv1.3 SSL_SECURE_RENEG=true SSL_COMPRESS_METHOD=NULL SSL_CIPHER=TLS_AES_256_GCM_SHA384 SSL_CIPHER_EXPORT=false SSL_CIPHER_USEKEYSIZE=256 SSL_CIPHER_ALGKEYSIZE=256 SSL_CLIENT_VERIFY=NONE SSL_SERVER_M_VERSION=3 SSL_SERVER_M_SERIAL=6E35378C54738ACB SSL_SERVER_V_START=Jan 20 18:05:35 2024 GMT SSL_SERVER_V_END=Feb 20 18:05:35 2025 GMT SSL_SERVER_S_DN=CN=*.cs.fiu.edu SSL_SERVER_I_DN=CN=Go Daddy Secure Certificate Authority - G2,OU=http://certs.godaddy.com/repository/,O=GoDaddy.com\, Inc.,L=Scottsdale,ST=Arizona,C=US SSL_SERVER_A_KEY=rsaEncryption SSL_SERVER_A_SIG=sha256WithRSAEncryption SSL_SESSION_ID=304e2210a7c57f34fef8e2f627fe1cf021a9cd4a9ed8214b8731a14bb1166078 SSL_SESSION_RESUMED=Initial HTTP_ACCEPT=*/* HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) HTTP_ACCEPT_ENCODING=gzip, br, zstd, deflate HTTP_HOST=users.cs.fiu.edu PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin SERVER_SIGNATURE= SERVER_SOFTWARE=Apache SERVER_NAME=users.cs.fiu.edu SERVER_ADDR=131.94.130.45 SERVER_PORT=443 REMOTE_ADDR=18.219.25.226 DOCUMENT_ROOT=/var/www/html REQUEST_SCHEME=https CONTEXT_PREFIX=/~downeyt CONTEXT_DOCUMENT_ROOT=/home/bear-d/users/downeyt/public_html SERVER_ADMIN=root@localhost SCRIPT_FILENAME=/home/bear-d/users/downeyt/public_html/cgs4825/ssi.shtml REMOTE_PORT=43904 GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.1 REQUEST_METHOD=GET QUERY_STRING= REQUEST_URI=/~downeyt/cgs4825/ssi.shtml SCRIPT_NAME=/~downeyt/cgs4825/ssi.shtml DATE_LOCAL=Monday 11/25/24 (day 330) at 02:52:17 PM DATE_GMT=Monday 11/25/24 (day 330) at 07:52:17 PM LAST_MODIFIED=Sunday DOCUMENT_URI=/~downeyt/cgs4825/ssi.shtml DOCUMENT_ARGS= USER_NAME=downeyt DOCUMENT_NAME=ssi.shtml fiu=www.fiu.edu