Tech Support Topics

Sphynx Site CGI

Guestlist CGI for Sphynx Site Users

This CGI program written in C allows you to have a guestlist or guestbook anywhere on your site. You can customize the look of the guestlist to fit your tastes. Example.

HTML Source for a Guestlist using "guestlist.cgi"

You will have two documents. One is the fill-out form that is posted to the cgi program. Name it "guestentry.html" (or something similar). The other is the guestlist itself, where visitors' comments and email addresses will be listed. Name it "guestlist.html" (or similar).

The Guestlist Page

The HTML source below represents the skeleton of the guestlist.html page. It is mandatory that the part of the guestlist indicated by bold text be left intact. The beginning and end of the page may be customized to your liking:


   <html>
   <head>
   <title>Guestlist</title>
   </head>
   <body>
   <h3>Guestlist</h3>
   <hr>
   <p>
   Feel free to add your name, EMail address, and 
   comments to the guestlist by using the 
   <A HREF="guestentry.html">Guestlist Entry Form<A>
   <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>


When it runs, the guestlist cgi inserts the guestlist entries between the lines:

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

Guestlist Entry Form

The HTML source below represents the guestlist entry form. This form can be customized to your liking as long as you retain the required fields.

PATHNAME represents the pathname of the guestlist file relative to server root. Where you see the word PATHNAME insert the path within your directory to the "guestlist.html" document.

For example, if you have the userid "compu-co" and "guestlist.html" is two levels below your root directory in the "list" directory within the "extras" directory, PATHNAME would be represented by:

   compu-co/extras/list   
and then you would append
   /guestlist.html
to get:
   <form method="POST" 
        action="/cgi-bin/guestlist.cgi/compu-co/extras/list/guestlist.html">

Here's the general form of the statement:

   <form method="POST" 
        action="/cgi-bin/guestlist.cgi/PATHNAME/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. In other words, when someone puts an entry on your guestlist page, the cgi program will mail you a copy of his or her comments and their email address.


MAXENTRIES should be set to the maximum number of entries you'd like to maintain on your list page. Good numbers are 500 or 1000. Just remember that the larger the list, the more of your site disk space it will take up. A list of 100 kilobytes in size is extremely large, however, and some browsers will not load a continuous text file that is much larger.


Here's the "guestentry.html" entry form in its entirety:
   <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/guestlist.cgi/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, NCSA offers some excellent resources.





HOME | SITE HOSTING | VIRTUAL SERVERS | PAGE DESIGN | FAQ | ORDER | TECH SUPPORT


Copyright © 1996, Sphynx Web Solutions. All rights reserved. All brand names and product names used on these web pages are trademarks, or trade names of their respective holders. Direct questions or comments to webmaster@sphynx.com.