track ip addresses, phone numbers, etc

SSI Includes

Published on 01 January 2007

How to embed CGI scripts in HTML files

In order to embed CGI scripts, first find if your web hosting company supports Server Side Include (SSI). Call or email your tech support to find this. [If you're hosting on Bluehost, yes they support SSI]

Testing the SSI include

Lets create a file called ssi.html that embeds a Perl script This Perl script outputs the current date and time when executed.

<!--#exec cmd=""--> - Create in the same directory with these contents:

!/usr/bin/perl -w

print date;

- If your CGI script is in another directory, you can call it from the HTML page using the include virtual directive
<h1>SSI Test</h1>

<!--#include virtual="/demo/"-->

- Make the script executable with by chmodding with +x or FTP client or whatever CP you use to access your files


Check out the working demo here.

Last Update: 01 January 2007 [Created on 02 January 2007]

TAGS: ssi, apache, cgi

Affiliate Disclosure: Some of the links to products on this blog are affiliate links. It simply means, at no additional cost to you, we’ll earn a commission if you click through and buy any product.