/////////////////////////////
Perl Guestbook
By Joeman345 (bfr)
http://bfr.tifreakware.net
/////////////////////////////

This file, readme.txt, explains how to use the guestbook.  guestbook.cgi and entry.cgi are the actual files that compose the guestbook.  guestbooksqlquery.txt includes the SQL query you need to run on your database in order for the guestbook to store data.  

What you do is, go to phpmyadmin and copy & paste the SQL query in guestbooksqlquery.txt, or you can just run the query by using the following perl code:

#!/usr/bin/perl

use DBI;

use CGI;

my $DataHandle = DBI->connect("dbi:mysql:database:host", "username", "password") or die "Unable to connect";

# Insert the SQL query code in the string $sql.  Remember to replace ` with \" !!!!!!

$sql = "[CODE GOES HERE]";
$statement = $DataHandle->prepare($sql);
$statement->execute(); 

$DataHandle->disconnect();

exit (0);


Then, you upload the code, guestbook.cgi and entry.cgi, to your host.  You must edit where it says "host","root", and "password".  You must also change "database" to whatever database you want to keep the data in.  Note that the page that contains the form for the guestbook and that displays the messages is guestbook.cgi, so if you add this guestbook to your website, link to guestbook.cgi, not entry.cgi.

This version should be compatible with the latest version of mySQL, and should work on other databases (but you probably need to change where it says DBI->connect("dbi:mysql:database:host ...).  

You are free to use this code and post it on your website, but I'd appreciate if you credit me and/or VDesign in some way. 

Questions?  Comments?  Visit my website at http://bfr.tifreakware.net or e-mail me at bfrsoccer@yahoo.com.