Guestlist

Last Updated: January 20, 2000

A simple way of interacting with clients that visit a web site is to allow them to sign a guestlist and leave some comments. A small form and custom CGI can be designed to facilitate such a task. The guestlist form and CGI source are presented in three sections below.

  1. The HTML source for the guestlist
  2. The source code for the guestlist CGI
  3. Installation instructions


The HTML Source for the Guestlist

The HTML source below represents the skeleton of a guestlist which will store the guest entries. It is recommended that the part of the guestlist in bold be left intact. The remainder of the page can be customized to your own liking.

  <html>
  <head>
  <title>Guestlist</title>
  </head>
  <body>
  <h3>Guestlist</h3>
  <hr size = 3>
  <p>
  Feel free to add your name, EMail address, and comments to the
  guestlist by using the Guestlist Entry Form.
  <p>
  <p align=center>
  <font size = "+1"><b>
  G U E S T L I S T
  </b></font>
  <!-- __GUESTLIST_BEGIN__ -->
  <!-- __GUESTLIST_END__ -->
  <p>
  <hr size = 3>
  </body>
  </html>

The guestlist entries are placed between the lines:

  <!-- __GUESTLIST_BEGIN__ --> 
  <!-- __GUESTLIST_END__ -->

The HTML source below represents the guestlist entry form. This form can be customized for your server by simply changing the occurrence of MAXENTRIES (shown in bold) to be the number of entries that will be displayed on the guestbook. For example, if MAXENTRIES is set to 100, only the latest 100 entries in the guestbook will be displayed. If MAXENTRIES is set to negative or zero (or not included in the form at all), no entry restriction will be applied.

PATHNAME represents the pathname of the guestlist file relative to the "htdocs" directory of your server. For example, if your guestlist file was named "guestlist.html" and was located in a subdirectory "guest" of your main "htdocs" directory, you would set PATHNAME to be "/guest/guestlist.html". If the file "guestlist.html" is located in your main "htdocs" directory, you would set PATHNAME to be "/guestlist.html".

ADDRESS should be set to the e-mail address where a copy of guestlist entries which include a return e-mail address are sent.

  <html>
  <head>
  <title>Guestlist Entry Form</title>
  </head>
  <body>
  <h3>Guestlist Entry Form</h3>
  <hr>
  <p>
  Thank you for taking the time to sign our guestlist.
  Feel free to add your name, EMail address, and comments to the guestbook
  by entering them in the form below.
  <p>
  <hr>
  <form method="POST" 
        action="/cgi-bin/library/guestlist/guestlist.pl/PATHNAME">
  
  <input name="recipient" type="hidden" value="ADDRESS">  
  <input name="maxentries" type="hidden" value="MAXENTRIES">  
  
  <font size="+1">Your Full Name:</font><br>
  <input name="name" size=50 maxlength=64>
  <p>
  
  <font size="+1">Your EMail address (optional):</font><br>
  <input name="email" size=50 maxlength=64>
  <p>
  
  <font size="+1">Your comments (optional):</font><br>
  <input name="comments" size=50 maxlength=256>
  <p>
  
  <input type="submit" value="Sign Guestlist">
  <input type="reset" value="Clear">
  <p>
  
  </form>
  <hr>
  </body>
  </html>

If you are unfamiliar with the FORM HTML element, or would like to learn more about forms, the following URL is an excellent resource:

http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/fill-out-forms/overview.html


The Source Code for the Guestlist CGI

The source code that handles the guestlist form contents is based on the post_query.c code that is provided with the NCSA httpd package, released to the public domain.

If you are unfamiliar with the CGI standard, or would like to learn more about the Common Gateway Interface, the following URL is an excellent resource:

http://hoohoo.ncsa.uiuc.edu/cgi/


How to Install the Guestlist

To install the comments form on your Virtual Server you will need to do the following:

  1. Download the Guestlist and Guestentry Forms
    You will need to store the Guestlist Form and Guestentry Form and store it somewhere in your "usr/local/etc/httpd/htdocs" directory structure. Feel free to customize the two pages, add graphics etc. Be sure that the variable name for each input field in the Guestentry Form is not altered.
  2. Download the Guestlist CGI source code
    You will need two source code files: guestlist.pl and util.pl.

          If you are an A Little Technology Shoppe, LLC customer

    1. login to your Virtual Server.
    2. change directories to your home directory (type "cd" and hit return)
    3. type "tar -xvf /usr/local/contrib/guestlist.tar"

          If you are not an A Little Technology Shoppe, LLC customer (sign up!)

    1. Verify that a directory path "library/guestlist" exists in your "cgi-bin" area.
    2. Download the two source files into your "cgi-bin/library/guestlist" directory and make sure the mode is set so that they will execute (chmod +x).

  3. Customize the Appearance of the Guestlist CGI
    Two subroutines in the util.pl file are used to print out header and footer information. These functions are print_header_info and print_footer_info. Feel free to modify these functions such that the CGI outputs pages that are in synch with the motifs of the rest of your site.

Once you have completed the installation successfully, you will have a working guestlist form like the one shown below (go ahead and test it).

  • Thank you for taking the time to sign our guestlist. Feel free to add your name, EMail address, and comments to the guestbook by entering them in the form below.


Your Full Name:

Your EMail address (optional):

Your comments (optional):


Copyright © 1996-2000. A Little Technology Shoppe, LLC. All rights reserved. All brand names and product names used on these web pages are trademarks, or trade names of their respective holders.