SSI

SSI is used to insert external files into a page, print system variables, and show results from CGI scripts. If you, for example, have a menu you can instead of writing 30 lines of code simply use one line on each page to show the same menu.

To use SSI, it requires that the page has the file extension .shtml.

Insert a text file

Use the following code to insert an external text file, which is located in the same directory.

<html>
<head><title>SSI test 1</title></head>
<body>
<!--#include file="insert.txt"-->
</body>
</html>

Use the following code to print out some information from the system, such as date, time and the IP number to the visitor.

<html>
<head><title>SSI test 2SSI</title></head>
<body>
<!--#echo var="DATE_LOCAL"-->
<!--#echo var="REMOTE_ADDR"-->
</body>
</html>

Show results from a CGI script

Use the following code to display results from a CGI script. This can be useful e.g. for a counter.

<html>
<head><title>SSI test 3</title></head>
<body>
<!--#exec cgi="/cgi-bin/count.cgi"-->
</body>
</html>

Our support does not cover script related problems that is not caused by one of our servers or similar, and we are unable to assist you with your programming.

If you have any problem with a script and want us to have a look at it, send the path to the script, a brief explanation of what you are trying to do and if you get an error messages to us.

Was this article helpful?

Related Articles