use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
#header for the ouput html file
#these are the default paths to search for files
push(@INC,"/var/apache/cgi-bin/");
#this subroutine extracts the data sent from the html program
#forms-lib.pl is found at /var/apache/cgi-bin/
require("forms-lib.pl");
#subroutine loads data into input hash array
%input = &GetFormInput();
#bring data into perl program
$firstname = $input{fname};
$lastname = $input{lname};
$uname = $input{uname};
$password = $input{pass};
$address = $input{address};
$city = $input{city};
$state = $input{state};
$zip = $input{zip};
use DBD::mysql;
use DBI;
$dbh=DBI->connect("dbi:mysql:me:131.xx.xx.xx:3306","me",'pass');
$sth = $dbh->prepare("INSERT INTO customer VALUES ('$firstname','$lastname','$uname','$password','$address','$city','$state','$zip')");
$sth->execute();
$sth->finish();
$dbh->disconnect();
$q = new CGI; #THIS IS THE PROBLEM!
print $q->redirect(" [myURL:port#...] ");
exit;
-------------------------------------------------------------------
this is the html: reg.html
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY>
<H1>
<CENTER>KBAY </CENTER></H1>
<P><FORM method=Post action=/cgi/kbay/reg.pl>
<P>Please fill out the following information for registration below.
<P>
<P>First Name: <INPUT type="text" name="fname"> Last Name: <INPUT type="text" name="lname">
<P>User name: <INPUT type="text" name="uname"> (your email address can be your username)
<P>password: <INPUT type="password" name="pass">
<P>
<P>Address: <INPUT type="text" name="address"> City: <INPUT type="text" name="city"> State:<INPUT type="text" name="state">
<P>Zip Code: <INPUT type="text" name="zip">
<P>
<INPUT name="SUBMIT" type="SUBMIT" value="reg">
</FORM>
</BODY></HTML>
this is what my log file says:[Sat Mar 10 16:42:29 2007] [error] [Sat Mar 10 16:42:29 2007] reg.pl: Can't locate object method "new" via package "CGI" (perhaps you forgot to load "CGI"?) at /var/projects/cps3500/groucho/cgi-bin/kbay/reg.pl line 42., referer: [myURL...]
please help.
[edited by: jatar_k at 4:49 am (utc) on Mar. 11, 2007]
[edit reason] removed specifics [/edit]
also I put this <meta blabla-equiv="Rfresh" bla bla url=bla/bla/index.html> in my html and it puts up a link to go to that page instead of automatically redirecting to that page.
lastly, how am i supposed to see the script if i dont have the html header at the top.