CGI Script Guestbook

CGI Script Guestbook

One of the easiest ways to make your website more interactive is to install a CGI script guestbook on your server. While it takes a little work "under the hood" of your site, with a little effort you can make it happen.

CGI Script Guestbook Sources

The first thing you're going to need to do is figure out what exactly you want your guestbook to do. Does it simply need to be a place where your visitors put an "X WAS HERE" mark? Or do you want them to be able to load an avatar, include links back to their site, use smileys, and also log their IP addresses, platforms, and other information?

The good news is that there are ways to go either route - the extremely simple and the "leet hacker" - and they're both totally free. CGI scripts were some of the first shareware items ever created on the web, and some of the first ones written are still around and free for the taking.

What is a CGI Script?

A CGI script is a script written in PHP or Perl and is then put into the cgi-bin folder on your server (as opposed to the folder where your images, HTML files, and other files are kept). The server knows to reference that cgi-bin whenever a particular function is called by a visitor to your site - for example, when a visitor decides to click on the "guestbook.php" page. The CGI script will then execute as many or as few commands that are programmed into it - as illustrated, as simple as "Nice site!- love, Gray" or as complex as forms and automatic replies.

You do want to be a little careful with where you get your CGI scripts from, especially if you're not really up to snuff when it comes to programming. Using a script with a good reputation, such as one from the venerable Matt's Script Archive would be safe. Any script from this site comes with the benefit of many years of both positive reviews and online user support. VizBook Plus is also a very popular script, and is one of the most fully-featured. It includes:

  • A "Search" Function
  • The ability to "moderate" the list
  • Visual options such as fonts, table widths, background images, etc.
  • An option for users to upload pictures
  • Message filtering by "bad" words or very long words.
  • HTML tags toggled on or off

There are many more options, if you're willing to configure them.

Configuration of Your Guest Book

Even the most simple guest book will have to have something configured on it. Sometimes this can be as complex as a MySQL database; if the thought of this intimidates you, you may want to select a more simple CGI script guestbook.

The script at Matt's script archive is about as simple as they get, with a Perl script that feeds into and rewrites the guestbook.html and guestlog.html files (the latter is a list of the domains and times that the entries were created). It does this through the addguest.html page, which accepts information from the guest in a form and sends it to the guestbook.pl script.

That script has four elements that have to be changed in order for the script to work:

  • $guestbookurl - The URL of the guestbook.html page.
  • $guestbookreal - The location of guestbook.html in relation to the perl script.
  • $guestlog - The location of guestlog.html in relation to the perl script.
  • $cgiurl - The location of your CGI-BIN folder, where the guestbook.pl file needs to reside. This file also needs to have the permissions set to read and execute for users (done either through the FTP program or using a UNIX command chmod a+rx).

There are other options, each toggled simply by selecting "1" for "on" and "0" for "off", but these can also be left as a default.

Learning to install a CGI script guestbook is a great way to learn how to increase your interaction with users.

CGI Script Guestbook