Setting Up a Guestbook
A guestbook is a fun addition to your Web pages. With a
guestbook, visitors to your pages may leave their names and some comments on a
public page for anyone to view. Take a look at this
to give you some idea of how it works.
Following are instructions to implement the guestbook script on your pages:
- At the bottom of this page, you'll find some HTML code. Copy that code into a text file.
Name the text file guestbook.html.
- Edit the HTML file to customize it. You will need to:
- Change the title
- Change the line that reads
<H1>My Guestbook Page</H1>, if you
- Change the line that begins:
<FORM METHOD="POST". You will
need to replace the words "
THE PATH TO THIS FILE" with the path to
your guestbook.html file. In this case, the path will be the same as the file's URL,
except with the "http://www.gate.net/" part not included.
Here's an example. Let's say the URL to my guestbook.html is
http://www.gate.net/~stevesh/guestbook.html. So I "cut off" the
"http://www.gate.net/" part, and replaced the words "
THE PATH TO THIS
FILE" with "
~stevesh/guestbook.html ". The resulting
- Add any additional text you wish to add to the bottom of your page, such as an address
listing or a mailto link.
- To make the guestbook.html file world-writeable, log into your
shell account and use the command: chmod 766 guestbook.html.
PPP accounts need to e-mail email@example.com
to change permissions to make the guestbook work.
- Load the guestbook page in your browser and try it out!
The guestbook.html code
<!-- You will need to customize this page for your own use. -->
<!-- See the comments included in the code for hints on customizing. -->
<H1>My Guestbook Page</H1>
<P>Hi, and welcome to my guestbook. Please sign below:</P>
<P>Last post on
<!-- Do NOT delete this line! --> <! - -LASTDATE- - >
<! - -GUESTBOOK- - > <!-- Do NOT delete this line! -->
<!-- Do NOT delete this line! --> <! - -POINTER- - >
Sign the guestbook:<BR>
<FORM METHOD="POST" ACTION="/cgi-bin/cgguest.pl/THE PATH TO THIS FILE">
<!-- Delete the words "THE PATH TO THIS FILE" and replace
them with the actual path to this html file. -->
<INPUT TYPE="text" NAME="name" SIZE="30" MAXLENGTH="30"><BR>
<INPUT TYPE="text" NAME="address" SIZE="30" MAXLENGTH="30"><BR>
Your URL (Optional):
<INPUT TYPE="text" NAME="url" SIZE="30" MAXLENGTH="30">
Your sites name (Optional): <INPUT TYPE="text"
NAME="urlname" SIZE="30" MAXLENGTH="30">
<TEXTAREA NAME="body" ROWS=15 COLS=60></TEXTAREA></P>
<INPUT TYPE="submit" NAME="" VALUE="POST">
<INPUT TYPE="reset" NAME="" VALUE="CLEAR">
<!-- Put additional text, like an address or something, here. -->
Things to Look Out For:
- Be careful when editing the FORM ACTION line to include your path. If you don't get the
path right, the guestbook will not function. The easiest thing is to remember that the
path is the URL with "http://www.gate.net/" removed.
- After you've been running the guestbook for a while, you will have a lot of old
guestbook entries built up on your page. The script will not automatically remove them,
but you can easily remove them by manually editing the guestbook.html file.
- When editing the guestbook.html file, be very careful not to remove the lines
<!--GUESTBOOK-->, <!--LASTDATE-->, and <!--POINTER-->. If you remove
those lines, the guestbook will not work!
If your guestbook does not work for you, check these things:
- Did you make the guestbook file world-writeable?
- Did you accidentally delete the lines <!--GUESTBOOK-->, <!--LASTDATE-->, and <!--POINTER-->?
- Did you enter the path correctly, without typos or miscapitalized words?