IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Design
Search Design Group:

Advanced
-Collapse +Expand Design Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBWebsite HostingFree Website...   Print This     
  From the February 2010 Issue of Prestwood eMag
 
Design Free Website Scripts:
Installing Matt's FREE Guestbook Script
 
Posted 17 years ago on 4/30/2007 and updated 1/17/2008
Take Away: Free Guestbook Script, web hosting, webmaster

KB100535

Installing Matt's Guestbook Script
If you've ever wanted to add a guest book to your web site you can thank the well-recognized Matt Wright for writing a wonderful Perl script and making it readily available via the web.

Guestbook Generator
In light of this script's popularity, we have installed a program generator to eliminate manual installation efforts. To install the Guestbook script within your web site, simply access your account Control Panel and select the Guestbook Installer option.

*** Important ***
The Guestbook Installer will overwrite previously installed Guestbook scripts.

Special Notes

  • Do NOT remove the <--begin--> tag within guestbook.html . This tells the Perl script where to insert new entries
  • You can modify the addguest.html and guestbook.html files to meet your own design standards

Guestbook Installation Notes

First time users should use the Guestbook Installer within the respective account Control Panel to install the Guestbook program. The instruction contained below is being provided for those whom wish to modify the script installed by the Guestbook Installer or to install multiple versions of this application.

Installation Procedure

  1. Locate and download the following files from Matt's Script Archive:
    • guestbook.pl - The Perl script which adds to the guestbook.html .
    • addguest.html - The form that users fill out to add their entry.
    • guestbook.html - The guestbook file that contained the users' entries.
    • guestlog.html - The short log of all guestbook entries. (optional)
  2. Create a subdirectory named "guestbook" within your web site and upload both guestbook.html and guestlog.html to the new directory
  3. Change the first line of the Perl script to reflect the official path to Perl on our server:
    #!/usr/local/bin/perl
  4. There are a few more things that need to be changed in the Perl script:
    # Set Variables  
    $guestbookurl - The URL address of your guestbook.html file
    $guestbookreal - The system location of your guestbook.html file
    $guestlog - The system location of your guestlog.html file
    $cgiurl - The URL portion of the address to the guestbook.pl file

    The second and third variables call for a system path which is not the same as a URL. If your domain name was yourdomain.com the system path would be /u/web/yourdo where "yourdo" is the account userid.

    As such, the Set Variables section of the Guestbook script would follow this format:

    # Set Variables  
    $guestbookurl = http://www.yourdomain.com/guestbook/guestbook.html;
    $guestbookreal = "/u/web/<userid>/guestbook/guestbook.html";
    $guestlog = "/u/web/<userid>/guestbook/guestlog.html";
    $cgiurl = http://www.yourdomain.com/cgi-local/guestbook.pl;
    $date_command = "/usr/bin/date";

    Be sure to substitute your domain name and userid in the example above. The path to "date" is properly set. Although Matt's code is accurate, we recommend using the Perl Script checker within your account Control Panel when installing any Perl script.

  5. Upload the "guestbook.pl" script to your cgi-local directory in ASCII transfer mode. Cgi-local will place the appropriate permissions on files uploaded to this directory so you do NOT need to chmod a+rx the Perl script.
  6. Modify the form ACTION attribute within "addguest.html" to reference the guestbook script within cgi-local as shown below and upload to the "guestbook" directory
    <FORM METHOD="POST" ACTION="/cgi-local/guestbook.pl">
  7. Select the File Manager option within your account Control Panel. Locate the file name guestbook.html within the guestbook directory. Click the box marked "PW" to the left of the guestbook.html file name to enable public write access. This will allow the Perl script to append data to the file guestbook.html .

You can test the script by referencing either the addguest.html or guestbook.html file via the web.

Special Notes

  • Do NOT remove the <--begin--> tag with guestbook.html . This tells the Perl script where to insert new entries
  • Some possible causes of a SERVER ERROR:
    • - Set Variables section within Perl script inaccurate
      - Perl script was not uploaded in ASCII transfer mode
      - Public-write permission not set for guestbook.html (see #7 above)
  • The reference to both the date and sendmail program are correct
  • You can modify the addguest.html and guestbook.html files to meet your own design standards

A Few Options

  • Set the $separator variable to display either a horizontal line or insert a paragraph tag between guest book entries
  • Set the $allow-html variable to allow visitors to use HTML tags within their entries

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1116A1
Enter key:
KB Post Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #100535 Counter
444135
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]