Description of /cgi-bin/guestbook
AOL /cgi-bin/guestbook Feature
Last updated: September 14, 1999
Table of Contents
-
Description
-
Setting It Up
-
Details & Suggestions
-
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
-
See
http://members.aol.com/wwwadmin/guestbook/gbook_sign.htm
for an example form,
http://members.aol.com/wwwadmin/guestbook/gbook.gbt
for an example template, and
http://members.aol.com/wwwadmin/guestbook/gbook.htm
for a sample data file.
-
Try using one of the templates created by
Building Home Pages.
-
The form, data file, and template need not be located in your top level
directory. However, keep the following in mind.
-
The data file and template must be located in the same directory.
-
These files may not appear in your FTP incoming directory.
-
You may have multiple guestbooks.
-
If you want to require users to provide values for some fields, add a hidden
field named required to your form. The value of the field should
be a comma separated list of the required fields. See this example.
<INPUT TYPE="hidden" NAME="required" VALUE="topic,email">
-
Users of your forms will normally get back a simple page that reads Thank
You!. You may specify a custom response page by adding a hidden field
named ResponsePage to your form. The value of the field should be
the URL of the page you want returned. See this example.
<INPUT TYPE="hidden" NAME="ResponsePage"
VALUE="http://members.aol.com/screenname/thanks.htm">
-
If you are an AOL member and wish to be notified via email when a new entry is added to your guestbook,
add a hidden field named notify to your form. You may also add
a hidden field named subject to set the subject of the email.
See this
example.
<INPUT TYPE="hidden" NAME="notify" VALUE="yes">
-
The POST must be done from a form hosted by AOL. If this is not true, the
guest book request will be denied.
-
If you wish to have the POST date included in your data file, insert #date#
into the template.
-
If you wish to have the POST time included in your data file, insert #time#
into the template.
-
Field names are considered to be case insensitive. For example, a field
named Comments in the form will match a field named comMEnts in
the template.
-
By default, any HTML tags entered into a form field will be stripped before
inserting into the data file. If you want your users to be able to insert
HTML, include a hidden field named AllowHTML in your form. The value
of the field should be yes. See this example.
<INPUT TYPE="hidden" NAME="AllowHTML" VALUE="yes">
-
The size of the template file is limited to 100,000 bytes.
-
The size of the data file is limited to 1,000,000 bytes. An email message
will be automatically sent to the guestbook owner when the guestbook is 90%
full. When the size limit is reached, attempted new entries will be
discarded and an error will be returned to the web browser.
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
Building Home Pages 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. 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.
-
In addition to the action and method attributes in the FORM tag, add
the target attribute, e.g., target="_top".
-
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>
|