At Home  |  At Work  |  Support  |  Find a Store  |  Search  |   View Cart 
 Shop Online or Call 1-800-211-4952
    Computer Software Accessories Services State and Local Federal
 Government
 Select from below.gvucation Services
 eSource
 Wireless Networking
 Total Cost of Ownership
 Custom Integrated Solutions
 Learning
 Financing Options
 Online Applications
 Web Site / Web Hosting

My Account
Customer Service
Sign up for offers!
G-Code
 Go

Hosting Support
eBusiness Services
Server Side Includes
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.

HTML files containing SSI must be named with an .shtml extension. (NT accounts can use .shtml, .shtm, and .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 Description
Date_Local Current date and time (determined by server location).
Date_GMT Current date and time in Greenwich Mean Time.
Document_Name File name of the main document.
Document_URI Path and file name of the main document
Last_Modified Date and time the main document was last modified.

Example:
Date and time determined by server location.

This code:   <!--#echo var="Date_Local" -->

will display:   Wednesday, 21-Jun-2000 04:13:47 EDT

On NT, the "echo" date commands do not include the time, unless #config timeframe="time options" is used first.



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:

This code:   <!--#config timefmt="%A, %B %d, %Y %I:%M%p" --> <!--#echo var="date_local" -->
will display:  Wednesday, June 21, 2000 04:13AM

Here is a breakdown date and time codes used in the example above:

%A Full weekday name
%B Full month name
%d Day of the month
%Y Year
%I Hour
%M Minutes
%p a.m. or p.m.


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.

e.g.   <!--#fsize file="image.gif" -->   output: 10k

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.

e.g.   <!--#include file="any.htm" -->

If the file to be included is in a different directory than the SHTML document. use the virtual command argument instead. In the following example, the SHTML document resides in a subdirectory but includes a file within account root directory:

eg.<!--#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.

eg.<!--#exec cgi="/cgi-local/date.pl" -->

This is more or less a get your feet wet page. To take the plunge, check out these sites.

 Sale subject to Limited Warranty and Terms & Conditions agreement.

Gateway.com  |  At Home  |  At Work  |  About Us  |  Contact Us  |  Site Map  |  Legal |  Privacy
Copyright © 2002 Gateway, Inc. All rights reserved.
Comments
Very Positive
Positive
Neutral
Negative
Very Negative
Questions About OnlineOpinion?
Questions About OnlineOpinion?