Section Title
Internet

SHTML
Include common components to webpages
 

Server Side Includes or SSI is an easy server-side scripting language used almost exclusively for the web. As its name implies, its primary use is including the contents of a file into another, via a Web Server.

SSI is primarily used to "paste" the contents of one or more files into another. For example, a file (of any type, .htm, .txt, etc.) containing a daily quote, could be included into multiple SSI Enabled pages throughout a website, by placing the following code

<!--#include virtual="..⁄quote.txt" -->
 

into the desired pages. With one change of the quote.txt file, pages including the snippet will display the latest daily quote. Server Side Includes are useful for including a common piece of code throughout a site, such as a navigation menu.

In order for a web server in a default configuration to recognise a SSI-enabled HTML file and therefore carry out these instructions, the file must end with the .shtml extension. SSI files can also end with .shtm but this depends on the server's ability to recognise the extension. It is possible to configure a web server to recognise any file with the .html file extension for server side include processing.

Today, SSI has largely been replaced by the more complex programming languages PHP, ASP and JSP.

 
====================================
 
SCRIPT :
 
You have to add this script in the body of SHTML file.
SHTML file is nothing but - just change the filename of HTML file.
 
 
<!--#include file="head.html" -->
 
 
 
=========================================
 
the file extension has to be *.shtml
& the results can be seen online or on internal webserver.
 
 
Editing in SHTML file :
1] Not possible with Dream weaver

2] Possible with frontpage 2003 & above
 
 
=========================================
 
e.g.
 
c1.shtml will have code :
 
<!DOCTYPE html PUBLIC "-⁄⁄W3C⁄⁄DTD XHTML 1.0 Transitional⁄⁄EN" "http:⁄⁄www.w3.org⁄TR⁄xhtml1⁄DTD⁄xhtml1-transitional.dtd">
<html xmlns="http:⁄⁄www.w3.org⁄1999⁄xhtml">
<head>
<meta http-equiv="Content-Type" content="text⁄html; charset=iso-8859-1" ⁄>
<title>Untitled Document<⁄title>
<⁄head>
 
<body>
<table width="952" border="1">
  <tr>
    <td><!--#include file="head.html" --><⁄td>
  <⁄tr>
  <tr>
    <td>Yes this is Row 2 in c1.shtml page . In Above Row i have included the file head.html<⁄td>
  <⁄tr>
<⁄table>
 
<p>&nbsp;<⁄p>
<p>&nbsp;<⁄p>
<p>&nbsp;<⁄p>
<p>
<⁄p>
<⁄body>
<⁄html>
===========================================
 
Results :
 
The Green Table with image is a part of head.html
 
 
================================================
 
Note ⁄ Ref. :

The usual view is that SSIs are a handful of standard "directives" placed in an .html page in the form of "SGML" (e.g. standard HTML language) comments. It is old technology, but still useful.

The directives tell the server to look at the content of the document before sending it to the browser, and to take action if it sees one of these directives.

The most important directive is the "include" command: <!--#include file="myincludefile.html" -->

This causes the server to insert the contents of "myincludefile.html" into the document being processed. It is effectively pasted into the document at the point where the directive is found. The include file may contain additional html commands, style sheets and even additional SSI directives.

Not all servers permit SSIs. Most Apache servers do. Check with your host first. There may be additional configurations needed to run them. Usually the including document must be named with a ".shtml" suffix, and the server has to be set to permit this.

One problem with SSIs, from the hosting point of view, is they slow down server processing. Another is that they create certain security concerns.

 
Ref. Link :
http:⁄⁄en.wikipedia.org⁄wiki⁄SHTML