The very name CGI used to send chills up my spine. For years I put it in 'too-hard-basket'. But like most things in life, CGI is not as scary as it seems. If you have a cgi directory on your website and you know how to FTP files, chances are you can have a CGI script up and running in less than 20 minutes.
CGI (Common Gateway Interface) is not a programming language but a standard that allows visitors to interact with your website. CGI scripts can be written in a number of different languages but most are written in Perl (Practical Extraction and Reporting Language).
This article gives you details of five free CGI scripts that will do following:
1. Mail out your Newsletter from your server 2. Track number of times your free E-Book is downloaded 3. Rotate banners on your website 4. Create your own auto responders 5. Allow visitors to recommend your website to friends
At end of this article are details of where to download these 5 free scripts. But first, here are some basic guidelines on how to configure and install CGI scripts:
1. CGI programs usually come in a zip file. Unzip file and open README file. This document will give you instructions for configuring program file.
2. Open program file using a text editor such as NOTEPAD (the program file will usually have file extension .cgi but may have other extensions such as .pl).
In most CGI programs you will have to configure following 4 items:
(a) path to perl
This is where perl program resides on your server. The path will usually be:
but could be:
If you're unsure what your 'path to perl' is, check your web host's online 'manual' or FAQs. If you can't find it there, simply ask your web host.
(b) path to sendmail
Most CGI programs notify you when your visitors have completed a particular action, and for that, program needs to know where 'sendmail' program resides on your server. The path to your UNIX sendmail program will usually be: /usr/sbin/sendmail
But it could also be something like this: /usr/lib/sendmail
Again, check documentation on your web host's website, or simply ask your web host.
(c) absolute path to your CGI directory
The absolute path tells CGI program exactly where to find file (or files) that it needs to open. Unfortunately, absolute path to your CGI directory is not something you will be able to guess or deduce - it is completely arbitrary and depends entirely on how system administrator at your web host has partitioned your host's hard drive.
The easiest way to find out your absolute path is to ask your web host. Another way is by using telnet - just type in pwd (print working directory) and that should give you your absolute path.
(d) Your email address
This is address that CGI program will use to notify you when an action has been completed.
Upload program files to your cgi-bin (or a directory off your cgi-bin) using ASCII mode. Never use BINARY mode, as this will play havoc with line-breaks in script.