WebSTAR SSI Demo

The WebSTAR SSI Plug-In allows you to use a wide range of "server-side include" commands in your HTML pages. It can show and hide information based on various conditions, display and increment counters, display file information, include other text or HTML files, execute CGI applications and include their output, and display a wide variety of information about the server, the client, and the data transferred between them. Most of these commands follow the
SSI specification established by the NCSA; the WebSTAR SSI Plug-In extends this set by adding a few extras, like the show and hide commands, counter commands, access to the WebSTAR API parameters, and automatic conversion of special characters.

To see how the commands on this page are used, open the "ssi_demo.ssi" file in a text editor. Select "View Source" in your browser to see how this file is modified by the WebSTAR SSI plug-in before being sent to the browser. More information on the syntax and command set used by the WebSTAR SSI Plug-In is available in the WebSTAR Server Suite manual.

NOTE: To see the demonstrations of the #exec and #include commands, turn on the "Allow unrestricted use of the #exec and #include commands" option in the Server Settings - Web Settings - SSI screen of the WebSTAR Admin application. See the WebSTAR Server Suite manual for more information.


ECHO VALUES

You can display a wide variety of information using the #echo command - Click on this link to display some of these parameters:
Load this page again

Most of the standard NCSA SSI parameters can be used (those not implemented are noted):

  • (Not Implemented):
    AUTH_TYPE =
  • Content Length as sent in HTTP Header:
    CONTENT_LENGTH = 0
  • Content Type as sent in HTTP Header (usually specified only when sent from an HTML form):
    CONTENT_TYPE =
  • GMT Date and Time:
    DATE_GMT = 2017/08/20:08:06:47
  • Local Date and Time:
    DATE_LOCAL = 2017/08/20:02:06:47
  • Path and Name of this file:
    DOCUMENT_NAME =
  • URI of this file (on disk, not relative to server):
    DOCUMENT_URI = /Tools%20&%20Examples/SSI%20Demo/ssi_demo.ssi
  • Interface of this SSI plug-in:
    GATEWAY_INTERFACE = W*API (version 1)
  • MIME-types accepted by browser:
    HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  • Hostname of HTTP server:
    HTTP_HOST = ahgi.com
  • Referring URL (empty if loaded directly):
    HTTP_REFERER =
  • WWW Client Software identification presented:
    HTTP_USER_AGENT = CCBot/2.0 (http://commoncrawl.org/faq/)
  • Date this file was last modified:
    LAST_MODIFIED = 2016/11/02:14:53:32
  • Path arguments (the part of the URL after the "$" symbol):
    PATH_INFO = Sarsaparilla%26Spumoni
  • URL decoded path arguments:
    PATH_TRANSLATED = Sarsaparilla&Spumoni
  • Query arguments (the part of the URL after the "?" symbol):
    QUERY_STRING = Saskatchewan%20Sunrise
  • URL decoded query arguments:
    QUERY_STRING_UNESCAPED = Saskatchewan Sunrise
  • Client's IP address or hostname (depending on the "Use DNS" setting in WebSTAR):
    REMOTE_ADDR = 54.167.194.4
  • Server's hostname:
    REMOT_HOST = 54.167.194.4
  • (Not Implemented):
    REMOTE_IDENT* =
  • Username passed by client (an obsolete value used only by very old browsers):
    REMOTE_USER =
  • HTTP Request method:
    REQUEST_METHOD = GET
  • Name and URL path of the requested file:
    SCRIPT_NAME = /Tools%20&%20Examples/SSI%20Demo/ssi_demo.ssi
  • Server's domain name:
    SERVER_NAME = 9.247.sfcn.org
  • Server's port number:
    SERVER_PORT = 80
  • HTTP Protocol used by server:
    SERVER_PROTOCOL = HTTP/1.0
  • Server Software:
    SERVER_SOFTWARE = WebSTAR/4.5(SSL) ID/74075

  • Any of the WebSTAR API parameters can also be used to display information, for example:

  • Server's domain name:
    piServerName = 9.247.sfcn.org
  • MIME type of requested URL in Suffix Mappings:
    piFileMIMEType = application/x-SSI
  • Local file system name for the requested file:
    piURLPhysicalPath = :Tools & Examples:SSI Demo:ssi_demo.ssi
  • Current amount of free memory available to the server:
    piCurrentFreeMemory = 197521184
  • Total bytes sent by the server since it was last started:
    piTotalBytesSent = 20756484

  • The #echo command can also be used to display special values, such as the current random number, the current value of any counter variables created by the #counter command, or any named variables created by the #store command (see the sections on "COUNTERS" and "STORED VARIABLES" for examples of how to display these values):

    Show current random number: 22


    INCLUDE FILE

    With the #include command, you can display the contents of a text or HTML file:


    FILE INFORMATION

    The #fsize and #flastmod commands will display size and date last modified for any file:

    File Size of the sample file included below: 781 bytes
    File Modified: 1999/03/21:18:26:10


    COUNTERS

    Using the #counter and #echo commands, you can increment and display the values of various counters:

    Counter 1 is: 75220
    Display the current value of Counter 1: 75220

    Counter 2 is: 225658
    Counter 2 incremented again without displaying it:
    Counter 2 incremented once again: 225660


    SHOW AND HIDE

    The SSI plug-in's #show and #hide commands can be used with a number of criteria:

    Show only to Netscape and compatibles:
    (based on http_user_agent = "CCBot/2.0 (http://commoncrawl.org/faq/)")

    Show after February 1998: Hello!
    (based on date_local = "2017/08/20:02:06:47")

    Show 40 percent of the time: Hello!
    (based on random = "22")

    Change random numbers and show either a green, yellow, or red square:
    (Based on random = "1")


    More sample #show and #hide commands:

    Show if the time is after noon:
    (Based on date_local = "2017/08/20:02:06:47")

    Don't show if this page is accessed directly, only when reached from a hyperlink (try reloading) :
    (Based on http_referer = "")

    Hide only if the QUERY_STRING is "Frans Hals" (follow this reload link): Hello!
    (Based on query_string_unescaped = "Saskatchewan Sunrise")

    Show only if the browser's IP address is 192.168.0.2:
    (Based on remote_addr = "54.167.194.4" -- change the "ssi_demo.ssi" file to reflect your own IP address)


    DISPLAY CGI OUTPUT

    The #exec command allows you to include the output of a CGI in your page:


    STORED VARIABLES

    The #store command allows you to store named variables and set whether these variables are persistent, available until the server is shut down, or local to the current SSI page only:

    Store the value "tangerine" in a persistent variable named "fruit" (view the ssi_demo.ssi file in a text editor to see the actual command used):

    Display the current contents of the variable named "fruit":

    fruit: tangerine

    POST ARGUMENTS

    The #postarg command will display the contents of named values sent in an HTML form (fill out the form and click the button below to display sample values):
    Off
    On
    Your name:
    Choose a flavor:

    Here's what you chose:

    Main Switch:
    Name:
    Flavor:
    Hidden Field:

    You can store these results in named variables with the #store command, then use #show and #hide commands to display something like the following when the form is filled out (open the ssi_demo.ssi file in a text editor to see the actual commands):


    CONFIGURE SSI

    Finally, the #config command gives you some options for changing the output of the WebSTAR SSI plug-in (open the ssi_demo.ssi file in a text editor to see the commands used):

    Set a custom error message (default error messages are normally contained in HTML comments):
    HEY!! AN ERROR OCCURRED IN ONE OF YOUR SSI COMMANDS!
    Change the file size value:
    Change the time format (a list of options can be found in the manual):
    Generate a new random number:
    The WebSTAR SSI plug-in also performs conversion of special characters in your HTML pages. You can set the default character translation option in the Server Settings - Web Settings - SSI screen of the WebSTAR Admin application, but you can also control the character translation for individual pages with a #config command. WebSTAR SSI allows you to translate special characters to the equivalent ISO Latin-1 entities, leave characters untranslated, or to restrict the character set to 7-bit ASCII:

    ISO Latin-1 conversion:

    Français Español Português

    Unconverted 8-bit characters:

    Franais Espa–ol Portugus

    ASCII character set:

    Fran ais Espaol Portugus