in reply to Retrieving Check Box Parameters
"I can't find how to retrieve the parameters for the checkboxes (I have more than one) so I can use if/else statements in order to alter database text file so I can increase the number of students listed as enrolled in those classes. What I'm looking for is the CGI code that allows me to use only the boxes that were checked."
The examples from the CGI 101 book's website may be too simple for your needs but...
#!/usr/bin/perl use warnings; use strict; use diagnostics; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); print header; print start_html; my @colors = ("red", "green", "blue", "gold"); foreach my $color (@colors) { if (param($color)) { print "You picked $color.<br>\n"; } } print end_html;
Swap @colors for @students :)
|
|---|