All of our UK web hosting plans support SSI (Server Side Includes) which allow CGI code to be called from within ordinary HTML pages.
The format for calling a CGI script using SSI is as follows: <!--#include virtual="filename.cgi" -->
The CGI script itself (filename.cgi in this case) will need to be executable and begin with a Content-type header, in the normal way. See Troubleshooting CGI Scripts.
SSI can also be used to include extracts of HTML code which are stored in another file. This allows you to keep sections of code which are common to more than one web page in a single file. The code can then be quickly and conveniently modified in just one place. This might be used for a navigation bar, for example.
The format for including a file of HTML code using SSI is essentially the same as when calling a CGI script: <!--#include virtual="filename.html" -->
If the CGI file to be run (or the HTML file to be included) is not in the same folder as the SSI file which is calling it, you will need to specify the path to the file. The path may be relative to the calling SSI file or, by starting the path with a / character, relative to your public_html folder. Files may not be included from above your public_html folder. In other words, the path works in the same way as a URL typed into a web browser, except that there is no need to include the domain name.
SSI pages should normally be given a .shtml extension, but SSI may also be configured to work with any file extension, including the standard .html and .htm extensions, if you should find this more convenient.
If you would like to learn more about SSI we recommend the SSI guide provided by BigNoseBird.com. |