How to Make a Guest Book

How to Make a Guest Book thumbnail
Simple guest book

Creating an online guest book is a typical task in designing both for commercial and personal sites. It can be done with a little or a lot of effort, depending on how complex you want to make it. One thing to keep in mind is that, depending on how much security is implemented in the guest book setup, it may open the creator's email address to hijack attempts.

Things You'll Need

  • Web design software or a text editor
Show More

Instructions

    • 1

      Choose whether to design the guest book from scratch using JavaScript, VBScript, ASP.NET or other software or by downloading a ready-made template, either free or for a fee. In the latter case, simply searching Google with a term like "guestbook samples" will produce many samples to follow. Another approach is to visit the Adobe Exchange site for downloadable templates (see Resources section below). Taking the former route involves knowledge of programming languages as explained in the following steps.

    • 2

      Use one of the available web development software programs such as Adobe Dreamweaver or Microsoft Expression or just a text editor to create a basic web page. The structure is automatically created in Dreamweaver or Expression and should look like these lines. For this example, the standard HTML tag indicators (left and right brackets < >) have been replaced with asterisks (*) to avoid executing the code. These should be changed in real use.

      *!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"*
      *html xmlns="http://www.w3.org/1999/xhtml"*
      *head*
      *meta http-equiv="Content-Type" content="text/html; charset=utf-8" /*
      *title*My Guestbook*/title*
      */head*
      *body*

      */body*
      */html*

    • 3

      Insert on a new line between the opening and closing *body* tags, a form with text fields for first and last name and email address and a text area for comments. The code will look like this:

      *form method="POST" ID="form" name="form " ACTION = "" /*
      *h3* *label*First and Last Name
      *input type="text" name="name" id="name" /* */label* */h3*
      *h3*
      *label*email
      *input type="text" name="email" id="email" /*
      */label*
      */h3*
      *p*
      *label*Comments*br /*
      *textarea name="comments" id="comments" cols="45" rows="5"**/textarea* */label*
      */p*
      *p* */p*
      *label*
      *input type="submit" name="submit" id="submit" value="Submit "/* */label*
      *input type="reset" name="Reset" id="Reset" value="Reset" /*
      */label*

    • 4

      Complete the process by changing the form "ACTION" contents in Step 3 to whatever type of setup you have for forwarding email. Since there are many ways to handle this, depending on the type of server operating system (UNIX or Microsoft Server), these all cannot be described here. One way, using ASP.NET and JMail, is to create another file using these lines of code in a separate file. Save this file under some name like "guest_mail.asp. " Point the ACTION step to the same file name. When done, upload both the HTML web file and the asp file to your web server.

      <%Option Explicit %>
      <%
      Dim msg
      Dim name
      dim email
      dim SenderEmail
      dim comments
      set msg = Server.CreateOBject( "JMail.Message" )
      msg.Logging = true
      msg.silent = true
      name=Request.Form("name")
      senderEmail=Request.Form ("email")
      comments=Request.Form("comments")
      msg.AddREcipient "[YourEmail@YourDomain.com]"
      msg.From = "[Guestbook@YourDomain.com"
      msg.FromName = SenderEmail
      msg.Subject = "I signed your Guestbook"
      msg.Body = comments
      if msg.Send( "localhost" ) then
      Response.Write( "Thank you for signing my Guestbook " )
      else
      Response.Write( "There was a problem with your entry. Please contact [YourEmail@YourDomain.com"] directly.
      End If
      %>

Tips & Warnings

  • Replace [YourEmail@YourDomain.com] with your true email address without the brackets. If you rename the fields on the form itself, then also rename them in the little Jmail script. If the form has a different name, then change this to match as well. The very last lines in the Jmail script ensure that the user will be notified if the guestbook signature does not go through. Most guest books are much more complicated and include provisions for maintaining a database of signatures.

  • Writing code manually like this requires absolute precision in keying in the code---the slightest missing or changed stroke can cause the program to fail. This is why most people choose to use ready-made templates. Test all your code before letting it go live or risk embarrassment.

Related Searches:

Resources

  • Photo Credit Charles R Anderson

Comments

You May Also Like

Related Ads

Featured