CGI: Guestbook Script

  1. At the bottom of this page, you'll find some HTML code. Copy that code into a textfile. Name the textfile guestbook.html.
  2. 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 want.
    • Change the line that begins: <form method="post".
      • Replace the words THE PATH TO THIS FILE with the path to your guestbook.html file. For example, if your guestbook is in a directory in your webspace called guestbook, the path would be: guestbook/guestbook.html.
      • The resulting line reads: <form method="post" action="">
    • Add any additional text you wish to add to the bottom of your page, such as an address listing or a mailto link.
  3. Use FTP to transfer the file to your webspace. Login using the webmaster login and password. Make sure you use your FTP program to change the permissions on the file to 777. Most FTP clients have an option called chmod or a selection of "UNIX commands." If you don't do this, the counter will not work.
  4. Load the guestbook page into your browser and try out the guestbook!

The guestbook.html Code

  <title>Example Guestbook</title>

  <!-- You will need to customize this page for your own use. -->
  <!-- See the comments included in the code for hints on customizing. -->
  <!--GUESTBOOK--> <!-- Do NOT delete this line! -->
  <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--> 
  <!-- Do NOT delete this line! --> <!--POINTER--> 

  <h2>Sign the Guestbook</h2>

  <form method="post" action=" path to this file">
  <!-- Delete the words "the path to this file" and replace them with
  the actual path to this html file. -->
      <label for="name">Name:</label> <input type="text"
      name="name" size="30" maxlength="30"><br />
      <label for="address">E-mail address:</label> <input
      type="text" name="address" size="30" maxlength="30"><br />
      <label for="body">Text:</label><br />
      <textarea name="body" rows=15 cols=60></textarea>

      <input type="submit" name="" value="post">
      <input type="reset" name="" value="clear">

  <!-- Put additional text, like an address or something, here. -->