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" -->
Friday, 09-May-2008 17:47:41 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" -->
This is output from a shell script named ssidemo.sh
<!--#exec cmd="cgi-bin/ssidemo.cgi" -->
This is Perl output from ssidemo.cgi
<XMP><!--#exec cmd="env" --></XMP>
SERVER_SIGNATURE=Apache/2.0.52 (Red Hat) Server at www.rexswain.com Port 80
LD_PRELOAD=
HTTP_USER_AGENT=CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
SERVER_PORT=80
HTTP_HOST=www.rexswain.com
DOCUMENT_ROOT=/var/www/html
HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7
SCRIPT_FILENAME=/var/www/html/ssidemo.shtml
REQUEST_URI=/ssidemo.shtml
USER_NAME=
SCRIPT_NAME=/ssidemo.shtml
HTTP_CONNECTION=close
REMOTE_PORT=48106
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
PWD=/var/www/html
SERVER_ADMIN=Postmaster@rexswain.com
HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5
DATE_GMT=
HTTP_ACCEPT=Accept: application/xhtml+xml,text/html;q=0.9,text/plain;
DOCUMENT_URI=/ssidemo.shtml
DATE_LOCAL=Friday, 09-May-2008 17:47:41 MDT
REMOTE_ADDR=38.103.63.16
SHLVL=1
SERVER_NAME=www.rexswain.com
LAST_MODIFIED=
HTTP_PRAGMA=no-cache
DOCUMENT_NAME=ssidemo.shtml
SERVER_SOFTWARE=Apache/2.0.52 (Red Hat)
QUERY_STRING=
SERVER_ADDR=69.36.187.33
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
HTTP_CACHE_CONTROL=no-cache
HTTP_ACCEPT_ENCODING=gzip
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]="i386-redhat-linux-gnu")
BASH_VERSION='3.00.15(1)-release'
DATE_GMT=
DATE_LOCAL='Friday, 09-May-2008 17:47:41 MDT'
DIRSTACK=()
DOCUMENT_NAME=ssidemo.shtml
DOCUMENT_ROOT=/var/www/html
DOCUMENT_URI=/ssidemo.shtml
EUID=2174
GATEWAY_INTERFACE=CGI/1.1
GROUPS=()
HOSTNAME=rexswain.com
HOSTTYPE=i386
HTTP_ACCEPT='Accept: application/xhtml+xml,text/html;q=0.9,text/plain;'
HTTP_ACCEPT_CHARSET='ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING=gzip
HTTP_ACCEPT_LANGUAGE='en-us,en;q=0.5'
HTTP_CACHE_CONTROL=no-cache
HTTP_CONNECTION=close
HTTP_HOST=www.rexswain.com
HTTP_PRAGMA=no-cache
HTTP_USER_AGENT='CCBot/1.0 (+http://www.commoncrawl.org/bot.html)'
IFS='
'
LAST_MODIFIED=
LD_PRELOAD=
MACHTYPE=i386-redhat-linux-gnu
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
POSIXLY_CORRECT=y
PPID=29954
PS4='+ '
PWD=/var/www/html
QUERY_STRING=
REMOTE_ADDR=38.103.63.16
REMOTE_PORT=48106
REQUEST_METHOD=GET
REQUEST_URI=/ssidemo.shtml
SCRIPT_FILENAME=/var/www/html/ssidemo.shtml
SCRIPT_NAME=/ssidemo.shtml
SERVER_ADDR=69.36.187.33
SERVER_ADMIN=Postmaster@rexswain.com
SERVER_NAME=www.rexswain.com
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.1
SERVER_SIGNATURE='Apache/2.0.52 (Red Hat) Server at www.rexswain.com Port 80
'
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=2174
USER_NAME=
_=/bin/sh
Other Summaries and Demos
- See my home page for other summaries and demos:
APL, REXX, XEDIT, Perl, HTML, RGB Colors, HTTP Cookies, Email Forms,
CGI Environment Variables, Server Side Includes, etc...
You are visitor
since 9 November 1996
Copyright © 1996-1999 Rex Swain
E-mail rex@rexswain.com,
Web http://www.rexswain.com