Guest Book Script
Based on a guestbook perl script by Matt Wright (email@example.com).
I added a built-in form that allows the user to review their entry as
it will look in html before saving it to the file. It preserves the
data during review in a form on the same page for editing.
No temporary files are necessary.
If you are currently using Matt's Guestbook script then my [guestbk2.pl] (12/4/95) can replace the
addguest.html and guestbook.pl (.cgi) files. Just make sure you point
your 'Add' link in the guestbook to the guestbk2.pl (.cgi).
The new script can use the same [guestbook.html] and [guestlog.html] files. If you have an older
version change the <META begin> to <!--begin--> where you
want new entries to appear in the guestbook.
See [Matt's Scripts]
for the original guestbook script, instructions and related files.
You are welcome to [View my Guestbook] or [Add] an entry to try out this script.
David Efflandt firstname.lastname@example.org
- [Comment Form]
Modifications to Original Script
6/2/97 added line to weed out <script> tags abused by hackers.
- If you GET the script, it will provide a form for data entry.
There are buttons for Test Entry, Final Entry and Reset.
- If you POST to the script with the Test Entry button or
any other form (like addguest.html) the script will come up with the
entry in html for review along with a form for editing existing data.
Buttons will again appear for Test Entry and Final Entry so any editing
can be tested.
- If you POST to the form with the Final Entry button
(name="final") the data will be saved and logged.
- External `date` programs and formats vary on different systems, so I
use perl localtime functions to get the date.
- Our server does not resolve REMOTE_HOST so I added code to resolve
the remote host from the IP address or log the IP address if that fails
- I also condensed many of the single ' if ' statements to reduce the
lines of code.
Standard time or daylight time is automatically selected.
- $server and $cgiurl are automatic from the environment
- $guestbookurl = "/~yourname/guestbook.html"; # - URL path to guestbook
- $guestbookreal = "/home/yourname/public_html/guestbook.html"; # - UNIX path
- $guestlog = "/home/yourname/public_html/guestlog.html"; # -
UNIX path to log
- $tz = "CST" # - Standard Time zone
- $dst = "CDT" # - Daylight Savings Time zone ($tz if none)
If you select to be advised of entries by Email:
- $mailprog = '/usr/lib/sendmail';
- $recipient = 'email@example.com';
times since 1/1/99.
Sample guestbook.html and guestlog.html
Save this page, cut each block of text below and paste to files:
Thank you for visiting our pages. We would love it if you would
Add to this guestbook we are keeping!
Guestbook Short Log
Short Log of Guestbook Entries
Below are the entries to the guestbook by domain and time. Included are
those that had errors and are noted by ERR.