A Simple Guest Book

For Windows NT/95

Version 1.5

Table Of Contents

What's New
Downloading
Installation
Usage
Troubleshooting
FAQ
Credits

What's New...

...in version 1.5
added ability to have multiple homepages on same server
added ability to specify location of homepage
better diagnostic information in the case of an error
fixed minor bugs
...in verison 1.0
initial implementation

Back to TOC

Downloading

Download book.zip.

If you are upgrading from version 1.0, you will need to erase any current book.cfg you have.

Proceed to Installation.

Back to TOC

Installation

  1. Unzip book.zip in your /cgi-bin or /cgi-shl directory. If you are using WinZip, you should use the "Use Directory Names" option, or, if you are using PKUNzip, use the -d option. The following directories and files are created:
    /cgi-bin (or /cgi-shl) <--server's CGI directory
       |
       |--book.exe         <--the CGI script
       |--book.html        <--Guest Book
       |--bookform.html    <--The form people fill in
       |--book.cfg         <--configuration file
       |
       |--/doc
           |
           |--book.html    <--this document
    
    The guest book program creates files called book.dat where it keeps track of how many people have signed in. It also uses the file lock.boo as a semaphore.
  2. Move the files bookform.html and book.html to your HTML document root directory.
  3. Edit the file bookform.html to your liking (see Usage below).
  4. Edit the file book.html so that instead of saying "My Guest Book" everywhere, it says what you want it to say. You should not add anything after the final <hr>.
  5. Edit the file book.cfg. Under the [Bookmaster] section, put your e-mail address. Under the [Guest_Book_URL] section, put the URL to the file book.html. Under the [Guest_Book_Filename] section, put the full path to the file book.html. And finally, under [Homepage_URL] put your homepage's URL. Sample book.cfg files are provided below.
  6. Proceed to Usage.
Back to TOC

Usage

It is very simple to use the guest book (thus the name :)). On your homepage, put something like the following: ...blah blah blah... <a href="/bookform.html">Sign my guest book!</a> ...blah blah blah... The ...blah blah blah... are optional, of course.

You should not attempt to edit the bookform.html file too much. Everything before the <FORM ACTION=...> and after the </FORM> is OK to edit, but in between, there really are only two things you should change:

The "How did you get here?" section can be modified fairly easily. Each of the entries except the "Following a Link" methods can be changed. For example, if you don't like the "Dumb Luck" entry, you can simply change everywhere that you see "Dumb Luck".

Note the different wording, however, in the value="..." section and after the final >. That's because the stuff in the value="..." part is preceded by "Found us by: " in the actual guest book, calling for gerunds where appropriate, whereas in the fill-out form it is preceded by "How did you get here?", which calls for a past particple. Example:

<dt><input type="radio" name="theWay" value="Using WebCrawler or other search engine">From WebCrawler or other search engine Notice the difference in the value="..." part and the part after the final >? Another example: suppose you want to add "Had monkey type in random URL" as a way for people to get to your homepage. Then add the following right before "Other means": <dt><input type="radio" name="theWay" value="Having monkey type in random URL">Had monkey type in random URL That's all there is to customizing this section. Now read the following section about having multiple guestbooks.
To have multiple guestbooks, follow this example. In this example, you want to keep a guest book of people who visit the URL e.g. http://www.myhost.com/somedir/ separate from those who visit the URL e.g. http://www.myhost.com/ (e.g. because the first may be a customer's homepage and the second the ISPs homepage). Suppose that your HTML root directory is C:\WWW\HTDOCS\. Then:

Copy bookform.html, book.html and book.cfg from the .ZIP file to C:\WWW\HTDOCS\ and to C:\WWW\HTDOCS\SOMEDIR\. Perform any of the changes described above that you want. Now, for bookform.html that is in C:\WWW\HTDOCS\, change the ACTION part to read:

<FORM METHOD="POST" ACTION="/cgi-bin/book.exe/"> Note the additional /! The additional / tells the guest book to look in the directory C:\WWW\HTDOCS\ (the HTML root) for all the files it needs. Without it, the guestbook looks in your /cgi-bin directory for the configuration file. Now edit book.cfg so that it looks like this: [Bookmaster] you@yourhost.com [Guest_Book_URL] /book.html [Guest_Book_Filename] c:\www\htdocs\book.html [Homepage_URL] / Now the guest book for http://www.myhost.com/ is the file C:\WWW\HTDOCS\BOOK.HTML.

Now, for the bookform.html in C:\WWW\HTDOCS\SOMEDIR\, edit the ACTION part so that it says:

<FORM METHOD="POST" ACTION="/cgi-bin/book.exe/somedir/"> Note that you must have the trailing /!. Doing this tells book.exe to look in C:\WWW\HTDOCS\SOMEDIR\ for the configuration file. Now edit the book.cfg in C:\WWW\HTDOCS\SOMEDIR\ to read: [Bookmaster] someelse@yourhost.com [Guest_Book_URL] /somedir/book.html [Guest_Book_Filename] c:\www\htdocs\somedir\book.html [Homepage_URL] /somedir/index.html

That's all there is to it. I hope this example is general enough to show you how to adapt it to your needs.

You should try signing the guest book first to make sure it is functioning. Go to the bookform.html page, fill it in (note that people only need to leave their names and cities) and press the "Sign the book" button. You should get a message like:

Thank You!

Thank you for taking the time to sign our guest book.

You were the 1st person to sign in.

Click here to read the guest book.

Return to homepage

Click where it says "click here". You should see something like:

My Guest Book

Name: Ryan Terry Sammartino
E-mail: samm@cs.ubc.ca
City: Vernon, BC
Homepage: http://www.cs.ubc.ca/spider/samm/
Found us by: Dumb luck
Comment: Cool Guest Book

Signed on: Sun Mar 03 10:48:28 1996

Back to TOC

Troubleshooting

P: I tried to sign my guest book, but one of the following happened:
I clicked on "Click here to see guest book" and I got URL not found.
S: Double-check what you put for the [Guest_Book_URL] section of book.cfg
I got a message saying "Can't find guestbook file"
S: Double-check what you put for the [Guest_Book_Filename] section.
I clicked on the "sign the book" button, and I got either garbage on my screen or Netscape asked me where to save "book.exe"?
S: Your server is not configured properly for CGI. See the CGI FAQ.
P: It is not keeping separate books like your example

S: Double check all the book.cfg files you have and make sure that they correctly identify the URL and filename of the guest book you are trying to keep. P: Something else went wrong.

S: E-mail me.

Back to TOC

FAQ

Q: Can people put HTML tags in any of the fields?

A: No. This is to prevent the guest book from getting screwed up by people sticking in poorly written HTML or worse, poorly written JavaScript. Some people also sign guest books and for the comment they put in <img src="..."> where ... is the URL of a XXX JPG. I'm sure you don't want that.

Q: How can I tell how many people have signed my book?

A: Look at the book.dat file.

Q: I want to remove someone from the guest book

A: Simply edit the file book.html. If you remove someone, you should also edit book.dat by decreasing the number there by one.

Q: Where do I send my $5?

A: 3212 Matapan Cr. Vancouver BC V5M 4B1 CANADA

Back to TOC

Credits

The guest book uses cgiC by Thomous Boutell. cgiC is copyright © Thomous Boutell.
Thanks also to my dad.
Back to TOC