Server inclusions SSI (a part 1)
From the point of view neprofessional`nala server inclusions, SSI (Server Side Includes) are special fillers in the HTML-document with which the server will replace with the real data directly ahead of sending with a browser of the final document. By then, as the document gets on a browser, he differs nothing from other pages as though the data are inserted into a HTML-code manually.
SSI allows to create structures for pages which will be dynamically generated by the server. For web-authors he can appear powerful sredsvom managements of development of a site and increase of his{its} efficiency. Examples of use SSI:
* Accommodation of repeatedly used elements. If imeeetsja an element which complex{difficult} navigating heading appears on each page of your site, for example, you can place the unique SSI-command which will be simple to copy it{him} in the initial text.
* Accommodation by one line of an element which constantly changes. For example, if you support a home page on which is present daily menjaemoj the message, use SSI command (and the script on the server) lja automatic replacement of the message.
* A conclusion of date and time of last updating.
* razmeshenie to numerous users predostovljat` contents for his{its} inclusion in web-page without granting of access by him{it} to an initial HTML-code. For example, an opportunity of transfer weekly obnovlenij on email. The server can start the script which will transform the message to a text file and then SSI command will insert it{him} on web-page.
* SSI can serve the web-page which is carrying out search from a browser. Even it is possible to serve documents on the basis of a domain name of the user.
The list of the basic server inclusions (SSI) and their attributes is below resulted:
CONFIG
ERRMSG - sets by default the message which is passed at detection of a mistake during parse of the document.
<! - *config errmsg = " Error: file not found "->
SIZEFMT - establishes a format used at display of the size of a file. Values - bytes or abbrev which approximates the size to the nearest kilobyte are allowable.
<! - *config sizefmt = "abbrev"->
TIMEFMT - establishes a format for time and dates. More in detail I shall tell about it below.
<! - *config timefmt = " %A, %B, %e, %Y "->
ECHO
VAR - value is the name of a variable with which it is necessary to print.
<! - *echo var = "DATE_GMT"->
EXEC
CGI - specifies a relative URL-way to script CGI:
You are visitor number <! - *exec cgi = "/cgi-bin/counter.pl"->
CMD - sets any command on the server. Variables SSI are accessible to this command.
<! - *exec cmd = " bin/finger $REMOTE_USER $ REMOTE_HOST "->
FSIZE
FILE - sets a site of a file as put, concerning the catalogue in which there is an analyzed document.
VIRTUAL - sets a way url concerning the current analyzed document. If he does not begin with slehsha (/) it is considered concerning to the current document.
The size of this file is <! - *fsize file = "somefile.html"->
FLASTMODE
FILE - sets a site of a file as a way, concerning the catalogue in which there is an analyzed document.
VIRTUAL - sets a way url concerning the current analyzed document. URL cannot contain the circuit or the host name, only a way. If he does not begin with slehsha (/) it is considered concerning to the current document.
This file was last modified on <! - *flastmode virtual = "/mydocs/somefile.html"->
INCLUDE
FILE - sets a site of a file as a way, concerning the catalogue in which there is an analyzed document. That is he cannot contain../Or to be absolute. The preference always should be given attribute virtual.
VIRTUAL - sets a way url concerning the analyzed document. URL should not contain the circuit or the host name. If he does not begin with slehsha (/) it is considered concerning to the current document.
<! - *include virtual = "somefile.html"->
PRINTENV
PRINTENV - it is used only Apache versions 1.2 and is higher. The element unpacks{prints out} the list of all existing variables and their values.
<! - *ptintenv->
SET
VAR - a name of an established{installed} variable.
VALUE - the value appropriated{given} by a variable.
<! - *set var = "password" value = "mustard"->

© Web Development Company Conkurent, LLC 2008-2009. All rights reserved. |