Complete installation and configuration guide for the Guestbook CGI script version 2.3.1
There are five files included in the Guestbook package:
| # | File | Description |
|---|---|---|
| 1 | README |
This file - installation and configuration instructions |
| 2 | guestbook.pl |
The Perl script that processes entries |
| 3 | guestbook.html |
The actual guestbook file displaying entries |
| 4 | addguest.html |
The fill-out form for new guestbook entries |
| 5 | guestlog.html |
A short log of those who have added entries |
This is the Perl script that actually writes new entries to files and returns the entry to the user. This file will need to be placed in the cgi-bin of your server and chmoded to a+rx (755).
chmod 755 guestbook.pl or chmod a+rx guestbook.pl
| Variable | Description |
|---|---|
$guestbookurl |
The URL address of your guestbook.html file. Example: "http://example.com/guestbook.html"
|
$guestbookreal |
The system location (absolute path) of your guestbook.html file. Example: "/home/user/public_html/guestbook.html"
|
$guestlog |
The system location of your guestlog.html file. Example: "/home/user/public_html/guestlog.html"
|
$cgiurl |
The URL portion of the address to the guestbook.pl file. The file needs to be placed in your server's cgi-bin and chmoded read/execute for users of your httpd (chmod a+rx).Example: "http://example.com/cgi-bin/guestbook.pl"
|
There are now several options that you have to decide whether or not to use. While choosing what options you want to have on, keep in mind that '1' will turn them on and '0' will turn them off.
This option will allow you to be notified via email when a new entry arrives in your guestbook. The entry will be mailed to you as a notification.
If you choose to turn this variable on, you will need to fill in these additional variables:
$recipient |
Your email address where notifications will be sent |
$mailprog |
The location of your sendmail program (e.g., /usr/sbin/sendmail) |
This will allow you the ability to use the short log feature. It is already turned on by default, so you will have to change it to 0 if you do not wish to use it.
The log feature is helpful because it will show errors, which is one nice aspect about it.
Turning this option on will make the email addresses in your guestbook become hyperlinked.
Instead of simply having ([email protected]), it will display <a href="mailto:[email protected]">[email protected]</a> so that anyone can simply click on the address to email them.
Many people prefer to separate entries with a Horizontal Rule <hr> instead of a Paragraph Separator <p>.
1 = Use <hr> separator (horizontal rule)0 = Use <p> separator (paragraph)Although Netscape and other browsers handle the auto-redirection quite nicely, it does not work with lynx (a text-based browser).
1 = Enable auto-redirection back to guestbook0 = Return a confirmation page with a link back to the guestbookWhen this script was first written, entries were always added next to the top, so users did not have to always see the same guestbook entry when they visited your pages.
1 = Newest entries at the top (default, like previous versions)0 = Newest entries at the bottom (oldest to newest)Many users have requested that a form letter be automatically sent to the remote user when they fill in the guestbook.
Turning this option on will tell the script to automatically mail any user who leaves an email address. By default, it sends a message that says "Thank you for adding to my guestbook." and shows them their entry.
If you turn this on, you will need to configure $recipient and $mailprog variables.
This option allows you to turn on or off the use of HTML tags by users of your guestbook.
1 = Allow users to embed HTML tags such as <b>, <H1>, or <a href=""></a>0 = Do not allow any HTML syntax in comments or other fieldsYou can still link to their email address by turning $linkmail to '1'.
Also new in version 2.3 is the ability for users to add their own URL, and then their name is referenced to their URL in the guestbook.html file. This helps eliminate the need for allow_html to be turned on.
If you wish to disable this option, simply delete the following line from your addguest.html file:
URL: <input type=text name=url size=50><br>
This option allows you to decide whether or not you want line breaks in the comment field to be turned into <br>'s in the HTML to retain the look of the guestbook entry.
1 = Convert line breaks to <br> tags0 = Do not convert line breaks (common setting, because sometimes people accidentally put in extra line breaks)This is the file that you will link to that will contain the Guestbook Entries.
chmod 666 guestbook.html or chmod a+rw guestbook.html
addguest.html file<!--begin--> from this guestbook, or else the script will have no way of knowing where to begin editing. This is the only necessary line in your guestbook.html file.
The link to the addguest.html file is also a good idea to include for user convenience.
This is the fill-out form to add a new entry into the guestbook.
action attribute of the form to point to the guestbook.pl file you placed in your cgi-binaction of the form should be the same as the $cgiurl variable you configured in your guestbook.pl file.
<form method="POST" action="http://example.com/cgi-bin/guestbook.pl">
This is a short log that lists domains and times that entries were created. It's much easier to browse and will point out those failed entries when users did not specify a name or comments.
chmod 666 guestlog.html or chmod a+rw guestlog.html
The log file is arranged so that newest entries are added at the bottom. This should be apparent since entries all come with a short date added.
You can avoid using this file by changing the $uselog option in the guestbook.pl file to 0.
<a href> mailto tag instead of outside<>'s to () in guestbook email addresses for better compatibility with email clientsThanks to Rick O'Donnell for pointing out the flaw and providing a fix.
| Version | Date | Changes |
|---|---|---|
| 2.3.1 | 10/29/95 |
|
| 2.3 | 10/14/95 |
|
| 2.21 | 10/08/95 |
|
| 2.2 | 08/23-24/95 |
|
| 2.1 | 05/29-06/07/95 |
|
| 2.0 | 05/26/95 |
|
| 1.1 | 05/13/95 |
|
| Variable | Type | Default | Description |
|---|---|---|---|
| Required Variables | |||
$guestbookurl |
URL | - | URL to guestbook.html |
$guestbookreal |
Path | - | System path to guestbook.html |
$guestlog |
Path | - | System path to guestlog.html |
$cgiurl |
URL | - | URL to guestbook.pl |
| Optional Variables (0=off, 1=on) | |||
$mail |
Boolean | 0 | Email notification on new entry |
$uselog |
Boolean | 1 | Use short log feature |
$linkmail |
Boolean | 1 | Make emails clickable |
$separator |
Boolean | 0 | Use <hr> (1) or <p> (0) |
$redirection |
Boolean | 1 | Auto-redirect after signing |
$entry_order |
Boolean | 1 | Newest first (1) or last (0) |
$remote_mail |
Boolean | 0 | Auto-reply to visitor |
$allow_html |
Boolean | 0 | Allow HTML in entries |
$line_breaks |
Boolean | 0 | Convert line breaks to <br> |
| Mail Variables (if $mail or $remote_mail = 1) | |||
$recipient |
- | Your email address | |
$mailprog |
Path | - | Path to sendmail |