Hi,
I tried your suggestion.
First, I did remove the $dbh from the subrouting and received an internal server error message.
Secondly, I also change my $dbh to our $dbh in hopes that would solve the problem. I received the same internal server error message.
I included the modified code. Any other ideas or thoughts?
#! /usr/local/bin/perl -Tw
use strict;
use lib qw(/usr163/home/w/s/wstrader/public_html/library);
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard escape escapeHTML);
use WebDB;
our $dbh = WebDB::connect ();
my $name = param("name");
my $coname = param("coname");
my $phone = param("phone");
my $email = param("email");
my $address = param("address");
my $city = param("city");
my $state = param("state");
my $zip = param("zip");
my $country = param("country");
my $page;
my $choice = lc (param ("choice"));
if ($choice eq "submit") # information submitted via form
{
store_items ();
}
else
{
$page .= p (escapeHTML ("Logic error, unknown choice: $choice"));
}
sub store_items
{
$dbh->do ("INSERT INTO contact_info
(contact_date,contact_name,company,telephone,email,addre
+ss,city,state,zip_code,country)
VALUES (CURRENT_DATE,?,?,?,?,?,?,?,?,?)",
undef,
$name,
$coname,
$phone,
$email,
$address,
$city,
$state,
$zip,
$country);
$dbh->disconnect();
}
|