Rex Swain's Server-Side Include Demo

Last updated 13 May 2005

View Source Code:
ssidemo.shtml   ssidemo.html   ssidemo.sh   ssidemo.cgi


Note that Netscape calls this facility "Server-Parsed HTML"; Microsoft calls them "Server-Side Includes".

Following is a demonstration of the commands used in server-parsed HTML. These commands are embedded in HTML files. The server replaces each command with data determined by the command and its attributes. The commands are "hidden" within HTML comments so they are ignored if not parsed by the server.

The format for a command is:

   <!--#command attribute1="value1" attribute2="value2" ... -->

For more information, see http://www.ssi-developer.net/ssi/

Support for SSI varies widely. Some ISPs only allow SSI commands in files with an ".shtml" extension. Some ISPs prohibit certain commands (particularly #exec). Some ISPs don't allow SSI at all. If you control your own server, you can probably turn SSI support on for all files.


<!--#echo var="DATE_LOCAL" -->

Sunday, 23-Apr-2017 03:48:45 MDT

<!--#include virtual="/ssidemo.html" -->

This is HTML code from file ssidemo.html

<!--#include file="ssidemo.html" -->

This is HTML code from file ssidemo.html

<!--#fsize file="ssidemo.html" -->

85

<!--#flastmod file="ssidemo.html" -->

Wednesday, 19-Jun-2002 00:00:00 MDT

<!--#exec cmd="cgi-bin/ssidemo.sh" -->

<!--#exec cmd="cgi-bin/ssidemo.cgi" -->

This is Perl output from ssidemo.cgi

<XMP><!--#exec cmd="env" --></XMP>

SERVER_SIGNATURE=<address>Apache/2.0.52 (Red Hat) Server at www.rexswain.com Port 80</address> LD_PRELOAD= HTTP_USER_AGENT=CCBot/2.0 (http://commoncrawl.org/faq/) SERVER_PORT=80 HTTP_HOST=www.rexswain.com DOCUMENT_ROOT=/var/www/html SCRIPT_FILENAME=/var/www/html/ssidemo.shtml REQUEST_URI=/ssidemo.shtml USER_NAME= SCRIPT_NAME=/ssidemo.shtml REMOTE_PORT=44746 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin PWD=/var/www/html SERVER_ADMIN=Postmaster@rexswain.com DATE_GMT= HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 DOCUMENT_URI=/ssidemo.shtml DATE_LOCAL=Sunday, 23-Apr-2017 03:48:45 MDT REMOTE_ADDR=54.161.70.252 SHLVL=1 SERVER_NAME=www.rexswain.com LAST_MODIFIED= DOCUMENT_NAME=ssidemo.shtml SERVER_SOFTWARE=Apache/2.0.52 (Red Hat) QUERY_STRING= SERVER_ADDR=206.130.113.68 GATEWAY_INTERFACE=CGI/1.1 SERVER_PROTOCOL=HTTP/1.0 HTTP_ACCEPT_ENCODING=x-gzip, gzip, deflate REQUEST_METHOD=GET _=/bin/env SPHERA_monitor=xxxx SPHERA_service=xxxx SPHERA_pIOr=xx SPHERA_pIOw=x SPHERA_pNETr=x SPHERA_pNETw=x SPHERA_config=x

<XMP><!--#exec cmd="set" --></XMP>

BASH=/bin/sh BASH_ARGC=() BASH_ARGV=() BASH_EXECUTION_STRING=set BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="3" [1]="00" [2]="15" [3]="1" [4]="release" [5]="i686-redhat-linux-gnu") BASH_VERSION='3.00.15(1)-release' DATE_GMT= DATE_LOCAL='Sunday, 23-Apr-2017 03:48:45 MDT' DIRSTACK=() DOCUMENT_NAME=ssidemo.shtml DOCUMENT_ROOT=/var/www/html DOCUMENT_URI=/ssidemo.shtml EUID=2012 GATEWAY_INTERFACE=CGI/1.1 GROUPS=() HOSTNAME=rexswain.com HOSTTYPE=i686 HTTP_ACCEPT='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' HTTP_ACCEPT_ENCODING='x-gzip, gzip, deflate' HTTP_HOST=www.rexswain.com HTTP_USER_AGENT='CCBot/2.0 (http://commoncrawl.org/faq/)' IFS=' ' LAST_MODIFIED= LD_PRELOAD= MACHTYPE=i686-redhat-linux-gnu OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin POSIXLY_CORRECT=y PPID=22444 PS4='+ ' PWD=/var/www/html QUERY_STRING= REMOTE_ADDR=54.161.70.252 REMOTE_PORT=44746 REQUEST_METHOD=GET REQUEST_URI=/ssidemo.shtml SCRIPT_FILENAME=/var/www/html/ssidemo.shtml SCRIPT_NAME=/ssidemo.shtml SERVER_ADDR=206.130.113.68 SERVER_ADMIN=Postmaster@rexswain.com SERVER_NAME=www.rexswain.com SERVER_PORT=80 SERVER_PROTOCOL=HTTP/1.0 SERVER_SIGNATURE='<address>Apache/2.0.52 (Red Hat) Server at www.rexswain.com Port 80</address> ' SERVER_SOFTWARE='Apache/2.0.52 (Red Hat)' SHELL=/ftponly SHELLOPTS=braceexpand:hashall:interactive-comments:posix SHLVL=1 SPHERA_config=x SPHERA_monitor=xxxx SPHERA_pIOr=x SPHERA_pIOw=x SPHERA_pNETr=x SPHERA_pNETw=x SPHERA_service=xxxx TERM=dumb UID=2012 USER_NAME= _=/bin/sh


Other Summaries and Demos


You are visitor [Odometer] since 9 November 1996

Copyright © 1996-1999 Rex Swain
E-mail rex@rexswain.com, Web http://www.rexswain.com