Surfnet GCI: guestbook.pl

guestbook.pl is a perl 5 script which allows you to add a guestbook page to your site. This allows visitors to sign your book to let you and others know they stopped by.

In order to use this feature, you will have to develop two pages:

guestbook.html The actual guestbook, itself.
guestform.html A form to allow your visitors to sign the guestbook.

You may call these pages anything that you wish, but they must contain some specific elements in order to work with guestbook.pl.

guestbook.html
guestbook.html is the actual guestbook itself. In its most elementary form, It looks like this:
<HTML>
<TITLE>Your title here</TITLE>
<HEAD>
</HEAD>
<BODY>
<!--You can erase individual entries by getting rid of:-->

<!--Begin Entry-->
<!--The contents of the entry would 
be in here but without the comment stuff-->
<!--End Entry-->

<!--Do not change or get rid of this line-->

</BODY>
</HTML>
Your new entries are placed below the line which says:

Do not change or get rid of this line.

Please take this warning seriously. If you do remove the line, your guestbook will not work!

You can add whatever formatting you wish to your guestbook. For an example, check out SurfnetUSA's guestbook.

guestform.html
This is the form that your visitors sign to place an entry in your guestbook. It can be in any format that you wish, however, it must call /cgi-bin/guestbook.cgi through the FORM tag, and must include the variables listed below for the guestbook to function correctly.

Here are example lines:

<form method=post action="/cgi-bin/guestbook.pl">
<input type=hidden name="logon" value="{logon}">
<input type=hidden name="bookname" value="{bookname}">
<input type=hidden name="bulleturl" value="{bulletURL}">
<input type=hidden name="separator" value="{separator}">
*Name: <input type=text name="realname"><BR>
*Email Address:<input type=text name="email"><BR>
Homepage Address: <input type=text name="homepage"><BR>
What would you like the title of your entry to be? <input type=text name="message"><BR>
*Comments:<br>
<textarea name="comments" rows=5 cols=60>
</textarea>
<input type=submit value="Sign The Guestbook">
<input type=reset value="Reset The Form">
</form>

For an example of a guestbook form, take a look at SurfnetUSA's guestbook form. NOTE: The SurfnetUSA guestbook does not use the required logon hidden field. SurfnetUSA subscribers are required to use this field.

Variable Comment
bookname A hidden field telling the script the name of the guestbook file to process:

<input type=hidden name="bookname" value="guestbook.html">

You may call your guestbook page any name you wish.

logon A hidden field telling the script your logon name:

<input type=hidden name="logon" value="fred">

This name is used to form the directory in which the program expects to find the guestbook. It creates a directory like this:

G:/PUBLIC/HOMEPAGES/{logon}/{bookname}

SurfnetUSA subscribers are required to use this field in their scripts.

bulleturl A hidden field telling the script the graphic to use for the bullets:

<input type=hidden name="bulleturl" value="/images/bl_pin.gif">

* The SurfnetUSA page uses /images/bl_pin.gif which produces an entry like the one at the start of this pargraph. Feel free to use that graphic on your page.

separator A hidden field telling the script the graphic to use for the separators between each entry:

<input type=hidden name="separator" value="/images/greenbar.jpg">

realname* The name of the visitor:

Name*: <input type=text name="realname">

email* The visitor's E-mail address:

Email Address*: <input type=text name="email">

homepage The visitor's homepage URL:

Homepage URL: <input type=text name="homepage">

This field becomes a link to their homepage on the guestbook page.

message The title for the visitor's message:

Entry Title: <input type=text name="message">

This field is printed at the start of the entry. It becomes a title for the entry.

comments* A text area for visitor's comments.

Comments*: <textarea name="comments" rows=5 cols=60></textarea>

* Indicates a required field. The user must enter this information. You should notify them of that fact.

Email: surfnet@surfnetusa.com
Phone: 408.430-0347 | Fax: 408.430-0247

© Copyright 1997 by SurfnetUSA. All rights reserved.