|
Why Aren't You Using CGI
|
By Michael Southon
[Hits: 25989]
|
|
The very name CGI used to send chills up my spine. For years Iput it in the 'too-hard-basket'. But like most things in life,CGI is not as scary as it seems. If you have a cgi directory onyour website and you know how to FTP files, chances are you canhave a CGI script up and running in less than 20 minutes.
CGI (Common Gateway Interface) is not a programming language buta standard that allows visitors to interact with your website.CGI scripts can be written in a number of different languagesbut most are written in Perl (Practical Extraction and ReportingLanguage).
This article gives you details of five free CGI scripts thatwill do the following:
1. Mail out your Newsletter from your server 2. Track the numberof times your free E-Book is downloaded 3. Rotate banners onyour website 4. Create your own auto responders 5. Allowvisitors to recommend your website to friends
At the end of this article are details of where to downloadthese 5 free scripts. But first, here are some basic guidelineson how to configure and install CGI scripts:
1. CGI programs usually come in a zip file. Unzip the file andopen the README file. This document will give you instructionsfor configuring the program file.
2. Open the program file using a text editor such as NOTEPAD(the program file will usually have the file extension .cgi butmay have other extensions such as .pl).
In most CGI programs you will have to configure the following 4items:
(a) the path to perl
This is where the perl program resides on your server. The pathwill usually be:
#!/usr/bin/perl
but could be:
#!/usr/local/bin/perl
If you're unsure what your 'path to perl' is, check your webhost's online 'manual' or FAQs. If you can't find it there,simply ask your web host.
(b) the path to sendmail
Most CGI programs notify you when your visitors have completed aparticular action, and for that, the program needs to know wherethe 'sendmail' program resides on your server. The path to yourUNIX sendmail program will usually be: /usr/sbin/sendmail
But it could also be something like this: /usr/lib/sendmail
Again, check the documentation on your web host's website, orsimply ask your web host.
(c) the absolute path to your CGI directory
The absolute path tells the CGI program exactly where to findthe file (or files) that it needs to open. Unfortunately, theabsolute path to your CGI directory is not something you will beable to guess or deduce - it is completely arbitrary and dependsentirely on how the system administrator at your web host haspartitioned your host's hard drive.
The easiest way to find out your absolute path is to ask yourweb host. Another way is by using telnet - just type in pwd(print working directory) and that should give you your absolutepath.
(d) Your email address
This is the address that the CGI program will use to notify youwhen an action has been completed.
3. Uploading
Upload the program files to your cgi-bin (or a directory offyour cgi-bin) using ASCII mode. Never use BINARY mode, as thiswill play havoc with the line-breaks in the script.
4. Set the File Permissions using CHMOD
CHMOD (changing mode) is the term for setting securitypermissions on files. The README file will usually tell you thepermissions that you need to set for each file. The script filewill need to be set to 755. This allows the file's owner toread, write, and execute the file; anyone else can only read andexecute it.
You can set the permissions using telnet, but the easiest way isto use the built-in option in your FTP program.
5. Calling the Script
Now that you've configured the script, uploaded it and set thepermissions, it's time to try it out! You do this by 'callingthe script' using a URL in an HTML document. This is what theURL for calling your script will normally look like:
http://www.yourdomain.com/cgi-bin/script.cgi
Again, the README file should have specific instructions on howto call the script. In addition, most CGI programs areaccompanied by a web page that contains the form your visitorswould use to call the script.
And now here are the details of the 5 free CGI scripts Imentioned earlier:
----------------------- Subscribe Me Lite-----------------------
Subscribe Me Lite is a program that allows prospects/customersto automatically subscribe and/or unsubscribe themselves fromyour mailing list. It has a built-in mass mailing form forsending out your newsletter or updates.
More Information:http://www.cgiscriptcenter.com/subscribe/index2.html
----------------------- Rob's File Tracker-----------------------
Rob's File Tracker is a perl script that counts file downloadsor click-thrus to any file. Very useful if you want to know howmany people are downloading your free E-Book.
More Information: http://www.robplanet.com/cgi racker/
----------------------- AdRotate Pro -----------------------
AdRotate Pro is an ad rotation program that's easy to setup andeasy to use. Features include unlimited rotations, expiry bydate, views or clicks, default ads for when all ads are expired,and customer reports.
More Information: http://www.vanbrunt.com/adrotate/
----------------------- MasterRecommend -----------------------
This script allows visitors to recommend your website to afriend by sending an email, without leaving your website. Theprogram will also send you a copy of your visitor's message(nice to know what your visitors think about your website).
More Information:http://www.willmaster.com/master/recommend/MasterRecommendmanual.html
----------------------- Master Auto-Responder-----------------------
This is a standard auto-responder program. The script allows youto set the "From:" and "Subject:" lines for yourauto-response.You can also choose to receive a copy of eachemail that the auto-responder receives.
More Information:http://mastercgi.com/howtoinfo/howautoresponderswork.shtml
If you need more help installing your CGI scripts, here are twoexcellent free tutorials:
http://spider-food.net/install-a-cgi-script.htmlhttp://www.stefan-pettersson.nu/scripts utorials/installcgi.html
|
|
|
|
|
|