drea900
05-02-2003, 10:39 PM
Hello I am having a hard time with this error message. I have uploading in ascii mode, chmod, and everything. Can anyone see why this code is giving me the Premature end of script headers: error in my servers error log.
#!/usr/bin/perl
use DBI;
print "Content-Type: text/html\015\012\015\012";
$dbh = DBI->connect
DBI->connect("DBI:mysql:drea900_mailinglist:localhost","username","password") or
dienice("Can not connect: ",$dbh->errstr);
$fname=param('fname');
$lname=param('lname');
$email=param('email');
$sth=$dbh=>prepare("INSERT INTO Cust_Info VALUES('$fname','$lname','$email'));
$sth->execute;
$sth->finish;
print<<pa
<body><h2>Hello $fname, <br></h2>
<h3>Your information has been recorded as follows: <p>
First Name: $fname<br>
Last Name: $lname<br>
Email Address: $email<br>
pa;
sub dienice {
($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}
#!/usr/bin/perl
use DBI;
print "Content-Type: text/html\015\012\015\012";
$dbh = DBI->connect
DBI->connect("DBI:mysql:drea900_mailinglist:localhost","username","password") or
dienice("Can not connect: ",$dbh->errstr);
$fname=param('fname');
$lname=param('lname');
$email=param('email');
$sth=$dbh=>prepare("INSERT INTO Cust_Info VALUES('$fname','$lname','$email'));
$sth->execute;
$sth->finish;
print<<pa
<body><h2>Hello $fname, <br></h2>
<h3>Your information has been recorded as follows: <p>
First Name: $fname<br>
Last Name: $lname<br>
Email Address: $email<br>
pa;
sub dienice {
($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}