in reply to Re^6: html checkbox and perl cgi
in thread html checkbox and perl cgi

OK, sorry I should have been clearer. You didn't copy the print statements correctly and you added a "}" right after them which caused errors. Another useful thing to do when you are debugging CGI scripts is to add the following line to the top of your script:
use CGI::Carp('fatalsToBrowser');
This will give you the reasons for the errors and where they occurred rather than the dreaded "Internal Server Error" message.

Just to get you past this, maybe it would be easier to just put the below lines before your whole script - click the 'download' link at the bottom and then copy and paste it right on the top line, forcing your original down. The '__END__' will exclude everything that comes after, as if you had commented it all out.

#!/usr/bin/perl -w use strict; use DBI; use CGI; use CGI::Carp('fatalsToBrowser'); my $query = new CGI; print $query->header(); if ($query->param('submit1')){ my $family = $query->param('family'); my $TB = $query->param('TB'); my $LM = $query->param('LM'); my $HS = $query->param('HS'); my $SC = $query->param('SC'); my $AT = $query->param('AT'); print "TB: $TB<br>"; print "LM: $LM<br>"; print "HS: $HS<br>"; print "SC: $SC<br>"; print "AT: $AT<br>"; } __END__

Replies are listed 'Best First'.
Re^8: html checkbox and perl cgi
by AdrianJ217 (Novice) on Jan 18, 2014 at 23:24 UTC
    Got it, thank you so much. So I tried it and the print statements were displayed correctly once I clicked submit, so that part is ok. I guess the problem is with the query to mySQL?
      You still haven't said what the problem is?
        Oh I'm sorry, the problem is that when I click submit, the results of the query to the database aren't displayed. The only thing displayed is the borders of the Table that I had asked to be printed in the CGI file. So the problem has to be with the "select" statement in the cgi file that queries mySQL right?