Webmaster-Showcase.net Server-Side Includes

Server-Side Includes (SSI) are HTML tags that look like comments but are parsed by the server when the page is served and replaced by other code. This is an old web technology that is not supported by all servers since it slows down serving. If the server supports SSI tags it must read every byte of the HTML files that it serves looking for SSI tags to replace.

The Yahoo! WebHosting service only publishes support for a few SSI tags. These are used to implement some of the AddOns. You may notice that placing the SSI tags on the page doesn't work unless you also "activate" it. I have noticed (via an FTP file listing) that HTML files have their execute bits set on the file permissions after the "activate" has been done. Yahoo! must use this to determine if it should parse the file for SSI tags.

Besides the published AddOn SSI tags I have discovered a few of the "standard" SSI tags also work on WebHosting servers. I have found some of these to be useful for generating a good custom error page. Note that, since these are not published, Yahoo! may stop supporting them at any time.

The unpublished SSI tags that I found are:
  • <!--#echo var="[some values]" -->
  • <!--#include file="[file name]" -->
I have discovered a few values that work with the "echo var" SSI tag. These tags only work in HTML files, they don't work in PHP files (because the server does not parse the output of the PHP script). Here is an example of an HTML file with SSI tags:ssiexamples.html. The source for that file is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
    <title>SSI Examples</title>
</head>

<body>
<h1 align="center">Examples of SSI tags</h1>
<h2>Unpublished "echo var" SSI tags</h2>
??? --&gt;&lt;!--#echo var="???" --&gt;<p>
SERVER_NAME --&gt;<!--#echo var="SERVER_NAME" --><br />
REDIRECT_URL --&gt;<!--#echo var="REDIRECT_URL" --><br />
DOCUMENT_URI --&gt;<!--#echo var="DOCUMENT_URI" --><br />
DOCUMENT_NAME --&gt;<!--#echo var="DOCUMENT_NAME" --><br />
LAST_MODIFIED --&gt;<!--#echo var="LAST_MODIFIED" --><br />
DATE_LOCAL --&gt;<!--#echo var="DATE_LOCAL" --><br />
DATE_GMT --&gt;<!--#echo var="DATE_GMT" --><br />
</p>

<h2>Unpublished "include file" SSI tag</h2>
&lt;!--#include file="test.inc" --&gt;<br />
<!--#include file="test.inc" --><br />

<h2>New Headlines implemeted as an SSI tag</h2>
<!-- Here is the code for Top Sports Stories from AP  -->
<!--#ynews news="aprs" n="5" hbc="3366CC" hfc="FFFFFF"
hff="Arial" hfs="4" ibc="CCCCFF" ifc="0000ff" iff="Times New Roman" ifs="3"
udd="1" ufc="FFFFFF" uff="Arial" ufs="2" ctry="us" tz="us" -->

<h2>Weather reports implemeted as an SSI tag</h2>
<!-- Here is the code for Ft. Wayne, IN  -->
<!--#ynews weather="46801" w="F" hbc="3366CC" hfc="FFFFFF"
hff="Arial" hfs="4" ibc="CCCCFF" ifc="0000ff" iff="Times New Roman" ifs="3"
udd="1" ufc="FFFFFF" uff="Arial" ufs="2" ctry="us" tz="us" -->

To show more than one location under one header, just put the codes for the weather parameter together in a comma-delimited list. For example, Fort Wayne and Mineapolis:
<!-- Here is the code for Ft. Wayne, IN and Minapolis, MN -->
<!--#ynews weather="46801,2360" w="F" hbc="3366CC" hfc="FFFFFF"
hff="Arial" hfs="4" ibc="CCCCFF" ifc="0000ff" iff="Times New Roman" ifs="3"
udd="1" ufc="FFFFFF" uff="Arial" ufs="2" ctry="us" tz="us" -->


<h2>
</body>
</html>
Home
Show Me How Feedback
Last updated: Fri Nov 8 17:04:18 2002