Using Server Side Include Commands
Server Side Include (SSI) commands are executed by the server as it parses your HTML file. Server side includes can be used to include the value of various server environment variables within your HTML such as the local date and time. One might use a server side include to add a signature file to an HTML file or company logo.
Note: SSI can only work on an account with CGI functionality enabled (i.e. RS-Per and higher)
HTML files containing SSI must be named differently than normal HTMl files. On our UNIX servers, SSI files must end in .shtml, whereas on NT servers files can be named .shtml, .shtm, or .stm .
SSI commands are easy to add to your HTML, but you must follow the syntax exactly:
<!-- #command cmd_argument="argument_value" -->
Be sure to leave a space after the ending quotation mark (") of the argument variable.
Using the echo Command
The echo command can be used to display the content of the five server side environment variables listed in the table below.
Variable
Date_Local
Date_GMT
Document_Name
Document_URI
Last_Modified
|
Description
Current date and time (determined by server location).
Current date and time in Greenwich Mean Time.
File name of the main document.
Path and file name of the main document
Date and time the main document was last modified.
|
Example:
Date and time determined by server location.
<!-- #echo var="Date_Local" -->
output: Monday, 14-Jul-97 11:33:04 EDT
Using the config Command
The config command can be used to configure the standard output of various environment variables. In the following example, two SSI commands are used in conjunction to produce an alternative date and time format:
<!-- #config timefmt="%A, %B %d, %Y %I:%M%p" -->
<!-- #echo var="date_local" -->
output: Monday, July 14, 1997 11:33AM
Here is a breakdown date and time codes used in the example above:
%A
%B
%d
%Y
%I
%M
%p
|
Full weekday name
Full month name
Day of the month
Year
Hour
Minutes
a.m. or p.m.
|
If the time does not show in your date command, you may need to preceed it with the following command:
<!-- #config timeframe="time options" -->
Other SSI Commands
The fsize command might be helpful if you were to include a thumbnail image and want to display the actual file size of the original image.
<!-- #fsize file="image.gif" --> output: 10.3k
The include command can be used to include a signature file or company logo within an HTML document. The added document or image will appear as if it were part of the original document.
<!-- #include file="any.htm" -->
If the file to be included is in a different directory than the SSI document. use the virtual command argument instead. In the following example, the SSI document resides in a subdirectory but includes a file within account root directory:
<!-- #include virtual="/any.htm" -->
The exec command can be used to execute a CGI script when the web page is loading. In the following example, the script date.pl within the relative path /cgi-local is executed.
<!-- #exec cgi="/cgi-local/date.pl" -->
You could also use the virtual command instead:
<!-- #include virtual="/cgi-local/script.pl?var1=value1&var2=value2" --> Ê
This is more or less a get your feet wet page. To take the plunge, check out these sites.
Prev | Next | Using Server Side Include Commands |
BIGSEA
A metaphor. A philosophy. A way of doing business.
Copyright 1997-2001 - Last update: Wednesday, March 21, 2001 at 2:03:35 PM
|