J. Blustein

Web-centric Computing

Some Example Code

SSI Test Page

This page looks different on

What works (and what doesn't)

  1. <!--#echo var="DATE_LOCAL" -->
    Saturday, 25-May-2013 08:06:50 ADT
  2. <!--#echo var="document_name" -->
    test1.shtml
  3. <!--#exec cmd="/usr/bin/echo exec works" -->
  4. Include virtual works on torch (see below)

Sometimes small differences matter...

  1. <!--#echo var="DATE_LOCAL" -->
    Saturday, 25-May-2013 08:06:50 ADT
  2. <!-- #echo var="DATE_LOCAL" -->

    Because of the extra space in the second example, the directive is not recognized

A whole lot of testing goin' on

  1. Date & Time

    1. <!--#echo var="DATE_LOCAL" -->
      Saturday, 25-May-2013 08:06:50 ADT
    2. <!--#echo var="Date_GMT" -->
      Saturday, 25-May-2013 11:06:50 GMT
  2. About this document

    1. <!--#echo var="DOCUMENT_NAME" -->
      test1.shtml
    2. <!--#echo var="DOCUMENT_URI" -->
      /~jamie/course/CS/3172/Materials/examples/SSI/test1.shtml
    3. <!--#echo var="last_modified" -->
      Wednesday, 10-Jun-2009 14:31:00 ADT
  3. About this server

    1. <!--#echo var="server_name" -->
      web.cs.dal.ca
    2. <!--#echo var="server_software" -->
      Apache
  4. About the user/browser

    1. <!--# echo var="HTTP_USER_AGENT" -->
      [an error occurred while processing this directive]
    2. <!--# echo var="GATEWAY_INTERFACE" -->
      [an error occurred while processing this directive]
    3. <!--#echo var="remote_addr" -->
      107.22.127.92
  5. Files on the server (executables and data files)

    1. <!--#exec cmd="/usr/bin/echo exec works" -->
    2. <!--#exec cmd="/usr/bin/id" -->
    3. <!--#exec cmd="/usr/bin/cat /etc/passwd" -->
  6. If

         <pre>
          <!--#if expr="apple=orange" -->
           If is not working
          <!--#else -->
           If *is* working
          <!--#endif -->
         </pre>
         
          
           If *is* working
          
         
  7. CGI executables within SSI

    1. CGI directive
                 <!--#exec cgi="/~maxwell/cgi-bin/test-cgi.cgi" -->
               
                 
               
    2. Include virtual directive
                 <pre>
      <!--#include virtual="/~maxwell/cgi-bin/test-cgi.cgi" -->
      </pre>
                  [an error occurred while processing this directive]
                

Important Notes


http://www.cs.dal.ca/~jamie/course/CS/3172/examples/SSI/test1.shtml
Version:
23 October 2001
Based on
ssitest.shtml from Chris Maxwell
Prof:
J. Blustein <jamie@cs.dal.ca>

Valid XHTML 1.0!