Click here to Skip to main content
15,885,918 members
Articles / Web Development / CSS

Perl Guestbook

Rate me:
Please Sign up or sign in to vote.
2.50/5 (8 votes)
24 Mar 2004CPOL5 min read 506.6K   952   12  
This article shows how to create a guestbook script using Perl. Data is stored in a MySQL table rather than in a flat file. DBI is used to connect to the database.
###################################################################################################
# Jon Sagara's Perl/MySQL Guestbook
#
# gb.sql - Table for creating the guestbook table, perl_gb.
#
# Copyright � 2002 Jon Sagara.  All rights reserved.
#
# This code may be used and modified in any way you desire. This file may be redistributed 
# unmodified by any means PROVIDING it is not sold for profit without the authors written consent, 
# and providing that this notice and the author's name and all copyright notices remains intact. 
#
# An email letting me know how you are using it would be nice as well. 
#
# This file is provided "as is" with no expressed or implied warranty. The author accepts no 
# liability for any damage/loss of business that this product may cause.
#
# Author:	Jon Sagara
# Web:		http://www.sagara.org/perlgb/
# Email:	http://www.sagara.org/contact.php
###################################################################################################


#
# Table structure for table `perl_gb`
#

drop table if exists perl_gb;
CREATE TABLE perl_gb (
  message_id int(10) unsigned NOT NULL auto_increment,
  post_date timestamp(14) NOT NULL,
  first_name varchar(15) NOT NULL default '',
  last_name varchar(20) NOT NULL default '',
  city varchar(20) default NULL,
  state varchar(18) default NULL,
  country varchar(25) default NULL,
  email_addr varchar(50) NOT NULL default '',
  url varchar(75) default NULL,
  ip_address char(15) DEFAULT NULL,
  comments text NOT NULL,
  PRIMARY KEY  (message_id)
) TYPE=MyISAM COMMENT='perl_gb';

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Sagara Software, Inc.
United States United States
Jon is a senior software developer who loves using .NET to solve problems.

When he's not fooling around with computers or reading, he's busy spending time with his super wife, Kelly, and his three boys. He also likes to take his mountain bike for a spin.

Visit my blog

Comments and Discussions