AOL /cgi-bin/guestbook Feature

Last updated: February 13, 1998

Table of Contents

  1. Description
  2. Setting It Up
  3. Details & Suggestions
  4. Frequently Asked Questions


Description

The guest book feature allows you to collect information from people browsing your web pages and save it in a file.  You define what information to collect by creating a HTML form and you define the format of the saved information by creating a template.  A member retrieves your form, fills it out and presses the submit button. A members.aol.com server uses the template and forms data to format and save the information. The member sees an HTML page that reads Thank You!. (See the ResponsePage option in the Details & Suggestions section below to find out how to add a customized thank you page.)


Setting It Up

STEP 1: Create a Form

Create a form with the action set as follows.

<form action="/cgi-bin/guestbook/screenname/myguests.html" method="POST">

Replace screenname with your AOL screen name and myguests.html with a name of your choice.  Note that myguests.html is the data file that will contain the information submitted by your users.

STEP 2: Create a Template

Create a template file and put that file in your web directory on members.aol.com. A template is a simple text message with markers (e.g., #fieldname#) that get filled in with the appropriate form data.  The name and directory of the template file must match the data file but the filename extension should be replaced with .gbt.

Here's a sample template file:

I'm interested in information about #topic#.

My name is #name# and I can be reached at #email#.

Thanks!

STEP 3: Initialize the Data File

In step 1 above, you identified the file that will capture the information submitted by your users.  Each user's submission will be added to the file using the format specified by the template you created in step 2.  If you are setting up a guest book that others will read, you may wish to provide an appealing introduction.  To do so, upload the data file with the desired introduction before deploying the form and template.


Details & Suggestions


Frequently Asked Questions

I create my pages with Personal Publisher 2 and I am having trouble creating a guestbook. What should I do?

Creating a guestbook is an intermediate HTML task intended for members with experience with an HTML editor such as AOLpress. Future versions of Personal Publisher may provide a streamlined method of creating a guestbook.

I've read the instructions and tried it.  I just can't get it to work.  Who can help me with my problem?

Check out a nice tutorial written by one of our members. Also, try posting details of your problem to a On The Net message board. See the WWWAdmin Home Page for other sources of AOL help.

Should I put HTML into my template?

The contents of the template is dependent on what you intend to do with the data file that will be generated. If you plan to read it with a web browser, you probably will want to include some HTML in the template.  If you plan to load it into a database or spreadsheet, you may wish to use a different format that does not include HTML.

Should my form use the ENCTYPE="text/plain" attribute?

No.  The ENCTYPE="text/plain" attribute can be used with a mailto URL to make the form data more easily readable by humans.  This attribute should not be used with cgi-bin/guestbook since the data will be processed by a computer.  With cgi-bin/guestbook, your template is used to convert the data into a readable form for you.

How can I verify the information entered by the user?

If you want to just verify specific fields do not have empty values, use the required hidden field described above. If you need more sophisticated verification, give JavaScript a try. See Verifying Form Input with Java Script or JavaScript Code Samples for more information.  Note that JavaScript is supported in most but not all web browsers.

The thank you page caused a problem because I am using Frames.  The end user has no way to go back from the thank you page to my page very gracefully.  What can I do?

There are 2 different ways that this can be addressed by changing the form.

  1. In addition to the action and method attributes in the FORM tag, add the target attribute, e.g., target="_top".
  2. If most of the links on your page are directed to the same location, you can use the BASE tag in the header to set a default destination and avoid specifying it for each reference. This will also apply to the form post.  For example:
<HEAD>
<TITLE>Ralph's Home Page</TITLE>
<BASE TARGET="_top">
</HEAD>