ot perl help request
Hello, I'm trying to get this script to do error checking but it prints
the error page every time regardless if there is or isn't input data.
It works ok without the if statement but I wanted it to do the
errorchecking. I spent a good amount of time trying to figure this out
on my own before emailing the list but I've learned perl is pretty
unforgiving when you have a misplace character or two.
Thanks for any help on this.
justin
#!/usr/bin/perl
use CGI;
$OUTPAGE = '/thankyou.html';
$DATAFILE = 'bla.txt';
$ERR = '/error.html';
my $cgi = new CGI;
$cgi->import_data('Q');
open (DATA, ">> $DATAFILE");
print DATA qq|$Q::name, $Q::email, $Q::menu, $ENV{REMOTE_ADDR}\n|; close
DATA;
if ($Q::{"name"} ne "") {
print $cgi->redirect(-location=>$ERR= '/error.html');
}
else {
print $cgi->redirect(-location=>$OUTPAGE= '/thanks.html');
}
--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: