Learn html ssi codes and tags using the sample below.
Html ssi
SSI - Server Side Includes
CODE |
<!--#include file="/relative/path/to/file.txt"-->
<!--#include virtual="/mapped/path/to/file.txt"-->
<!--#echo var="HTTP_SERVER_VARIABLE"-->
<!--#exec cmd="/virtual/path/to/some.exe"-->
Explanation
Examples of usage:
<HTML>
<HEAD></HEAD>
<BODY>
<!--#include virtual="/corporate-header.txt"-->
Welcome, <!--#echo var="REMOTE_HOST"-->!<BR>
I see you came here from
"<!--#echo var="HTTP_REFERRER"-->!"<BR>
You are the
<!--#exec cgi="/cgi-bin/hit-counter.cgi"-->th
person to view this page.
</BODY>
</HTML>
|
BROWSER |
Acme Web Design
Welcome, Visitors_computer_name!
I see you came here from "http://www.yahoo.com/search.htm"
You are the 453,698th person to view this page.
|
The file "coporate-header.txt", in the sample case, would only contain
<H1>Acme Web Design</H1>
to produce the results above. Perhaps you can see the power of this. If all your web pages use server included headers, you only would need to update one file, "corporate-header.txt", to update the entire web site.
A word of caution, however. If your web site depends on server-side include content and it fails, your visitors may see an error message in place of your logo! Most SSI failure is caused by the content to be included, not the server.
Explanation
- Syntax: <!--#command argument="/path/file"-->
For server-side includes to work, the ISP hosting your web site must first have their web server configured to support them. Next, any html file containing server-side include code must be named with one of the follwing extensions:
- .shtml (for UNIX based web servers)
- .asp (for WindowsNT web servers)
The file extension tells the web server to "read" the file before sending it to the browser and replace any include statements with the "content" specified, using the command specified. If the "content" is executable, the server will include the output. WebCreator cannot preview any SSI content. You will have to place your files on a web server to test them. Back to top
HTTP Server Variables
The list of available HTTP Server Variables can differ from server to server (like HTTP_REFERER and HTTP_REFERRER). It depends on which web server software being used and how it is configured. As such, you will have to consult your ISP to find out if they are supporting server-side includes and which HTTP Server Variables are available. Here are two examples:
HTTP SERVER VARIABLES (Microsoft IIS 3.0) |
CONTENT_TYPE |
The nature of this file. (MIME-type, i.e. text/html) |
GATEWAY_INTERFACE |
If this file was retrieved with a form post, this is the name of the method used. Commonly CGI/1.1 |
PATH_INFO |
"Virtual" mapped path of this file on the server. |
PATH_TRANSLATED |
Actual physical path of this file on the server. |
QUERY_STRING |
If this page was retrieved through a form post, this is what was suffixed to the URL when sent. |
REMOTE_ADDR |
The visitor's IP address. |
REMOTE_HOST |
The visitor's computer-name. |
SERVER_NAME |
The name of the computer this page originated from. |
SERVER_PORT |
The "port" used to retrieve this file. Usually :80. |
SERVER_PROTOCOL |
Protocol used to retrieve this file. Usually HTTP/1.0. |
SERVER_SOFTWARE |
The web server software version info. |
URL |
The URL of this file. |
HTTP_HOST |
The host/domain name this page came from. |
HTTP_REFERER |
The page your visitor clicked through to get here. |
HTTP_USER_AGENT |
Your visitor's browser information. |
HTTP_COOKIE |
The name and contents of any cookie you've placed on the visitor's computer. |
And a second example:
ENVIRONMENT VARIABLES (NCSA HTTPd 1.1) |
DOCUMENT_NAME |
The current filename. |
DOCUMENT_URI |
The virtual path to this document (like /path/to/file.shtml). |
QUERY_STRING_UNESCAPED |
The unescaped version of any search query the client sent, with all shell-special characters escaped with \. |
DATE_LOCAL |
The current date, local time zone. |
DATE_GMT |
Same as DATE_LOCAL but in Greenwich mean time. |
LAST_MODIFIED |
The last modification date of this file. |
Html ssi source code
|
Html ssi tutorial
Html ssi code on this is provided for your study purpose, it will guide you to know how create and design a website using html. use it to practice and train your self online
All the tutorials on this site are free, the page code is provifed for you to use it to practice, if you want to help to improve and maintain this work, you can donate to us on.
Html tutorial guide and web design in easy steps
|
Beginners guide to html
Html tag
object meta ul paragraph table dl bdo insdel checkbox fieldset ascii code anchor nobr blockquote textformat divspan abbracro ssi q css form ol address image
|