Server Side Includes (SSI) on your Hosting Account


Currently Supported SSI Tags

Serv  Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the Web. The most frequent use of SSI is to include the contents of one or more files into a web page on a web server.

SSI, SHTML is an HTML file that includes server or server-side instructions, similar to an ASP file. This file is commonly used to identify files containing server instructions and what ones do not to help load each page as fast as possible. Nowadays, web hosting companies are also using this language because it’s perfect in terms of security.

When an SHTML webpage is sent to the web browser window, it gets assembled on the server and then sent to be viewed. The standard HTML tags work the same; the SHTML lets you INCLUDE other pieces into the HTML page. Web hosting companies also use SHTML as a primary language for creating web pages.

The Hypertext Transfer Protocol facility is referred to as a server-side inclusion. (Although rarely done, the server administrator can identify some other file name suffix than “.shtml” as a server-side included file.) You can think of a server-side included as a limited form of common gateway interface application. The CGI is not used. The server searches the server-side include file for CGI environment variables and inserts the variable information in the places in the file where the “include” statements have been inserted.

The Server-side includes snippets of code that simplify Web site maintenance and make Web site pages interactive. This and their simplicity of implementation make them attractive to web programmers, but their risks must be understood and avoided. Using server-side includes to display environment variables and file statistics (“#echo var=”) poses no security risk; likewise, using the “#include” function, provided that the directory containing the included file is not Web-accessible.

When there is no Web server root directory access, the “#exec” directive can be turned on or off in specified directories using appropriate statements in a ‘.htaccess’ file in each directory. The ‘.htaccess’ file is the directory-level equivalent of the root-level configuration file. If the Web site is hosted by an external hosting company or Internet Service Provider, access to the Web server’s root directory is very unlikely, and ‘.htaccess’ files can be used.

As a simple programming language, SSI supports only one type: text. Its control flow is relatively simple; the choice is supported, but loops are not natively supported and can only be done by recursion using include or HTTP redirect. The simple design of the language makes it easier to learn and use than most server-side scripting languages. In contrast, complicated server-side processing is often done with one of the more feature-rich programming languages. Apache, Nginx, Lighttpd and IIS are the four central web servers that support this language.

The following is a list of the currently supported SSI+ tags:

  • Echo tag allows inserting certain variables’ data into an HTML page.
  • Include title provides for inserting the contents of a file into the HTML page at the location of the include token.
  • The Fsize tag allows inserting the size of a given file into the HTML page at the site of the Fsize token.
  • The Flastmod tag allows inserting the last modification date of a given file into the HTML page at the location of the Flastmod token.
  • Exec tag provides for executing an external executable.
  • The configure tag provides settings for specific HTML output options.
  • The Odbc tag is provided for querying and updating ODBC databases.
  • The email tag allows for emailing whenever an HTML page is accessed, or an HTML form is submitted.
  • If tag provides for conditional execution of SSI operations and conditional printing of HTML text based on logical comparisons.
  • The Goto tag allows jumping to a label token without executing any SSI code or printing HTML text between the goto token and label token.
  • Label tag provides a place to jump to a goto or goto token.
  • Break tag provides for the termination of HTML documents at any point.

Go Top