
Available Scripts:
Form-to-Mail
These require the CGI.pm module (which is included with Perl these days), and were designed to run on Unix with access to a sendmail program (for those that send mail).
Counter
Message Board
There are a lot more programs available on the CGI Resource Index:
![]()
You may also want to check out the nms scripts on Sourceforge.
If you're interested in learning how to write your own CGI programs, click here.
Usable for guestbooks, and any other form where you want to email yourself the data. Jan 2004: This has been modified to prevent it from being hijacked by spammers.
- mail-form.cgi - a simple, barebones guestbook CGI program - just change the $recipient value in the script to your email address. WARNING: Do not let the form specify ANY of the mail headers. This is how spammers can hijack your program to send out thousands of spam mails!
Counters are popular. Here are two variations:
- txcounter.cgi - designed to be called via Server-Side Include
- counter.cgi is a simple hidden counter. It is designed to be used in lieu of an image tag, so instead of doing
<img src="whatever.gif">, you would use<img src="counter.cgi">. The script increments a counter in a file, then returns the gif image. The person visiting your page need never know you have an embedded counter going.
My second book CGI Programming 201 shows readers how to build a CGI-based message board. If you'd like to just download the board code itself, you can download it here (8K tar/gzip archive). You will need Perl, Unix, MySQL, and the Perl modules DBI.pm, CGI.pm, and HTML::TagFilter (all downloadable from http://search.cpan.org).