R
Robert Valcourt
Greetings,
I have a Website form with 4 checkboxes each with the same name but
different values. I use cgi.pm to build an @array from these values but it
doesn't seem to be working. The script:
#!/usr/bin/perl
use CGI qwstandard);
use CGI::Carp qw(fatalsToBrowser);
use strict;
my @services = param('service');
foreach my $choice (@services) {
$choice = "$choice<br>";
}
print "Content-type: text/html \n\n";
print @services;
exit;
The result is an empty page. The page should have up to 4 lines of text with
the values of the checkboxes as seen below.
Here is what is odd, I use this same exact script for another website that
is on the same server, accesses the same perl library and it works just
fine. The only difference if the site that works has a doctype of 4.01
transitional and is .html and the one that doesn't work doctype xhtml 1.0
and is .php. I wonder if this is an issue. The form:
<form method="post" action="request-quote.pl">
<input type="checkbox" name="service" value="Outdoor Recreation">
<input type="checkbox" name="service" value="Education Programming">
<input type="checkbox" name="service" value="Retreat">
<input type="checkbox" name="service" value="Accommodations">
</form>
I "could" name each of the checkboxes different but i'd like to make this
work if possible as does my other script. For what it is worth I have also
tried:
use CGI;
my $q = new CGI;
my @services = $q->param('service');
As described from post:
http://groups.google.ca/group/comp....read/thread/c6fdb07ada986311/75482491e9e6a6fa
CGI.pm is supposed to handle this right? I'm really scratching my head on
this one and its starting to hurt.
TIA
Robert
I have a Website form with 4 checkboxes each with the same name but
different values. I use cgi.pm to build an @array from these values but it
doesn't seem to be working. The script:
#!/usr/bin/perl
use CGI qwstandard);
use CGI::Carp qw(fatalsToBrowser);
use strict;
my @services = param('service');
foreach my $choice (@services) {
$choice = "$choice<br>";
}
print "Content-type: text/html \n\n";
print @services;
exit;
The result is an empty page. The page should have up to 4 lines of text with
the values of the checkboxes as seen below.
Here is what is odd, I use this same exact script for another website that
is on the same server, accesses the same perl library and it works just
fine. The only difference if the site that works has a doctype of 4.01
transitional and is .html and the one that doesn't work doctype xhtml 1.0
and is .php. I wonder if this is an issue. The form:
<form method="post" action="request-quote.pl">
<input type="checkbox" name="service" value="Outdoor Recreation">
<input type="checkbox" name="service" value="Education Programming">
<input type="checkbox" name="service" value="Retreat">
<input type="checkbox" name="service" value="Accommodations">
</form>
I "could" name each of the checkboxes different but i'd like to make this
work if possible as does my other script. For what it is worth I have also
tried:
use CGI;
my $q = new CGI;
my @services = $q->param('service');
As described from post:
http://groups.google.ca/group/comp....read/thread/c6fdb07ada986311/75482491e9e6a6fa
CGI.pm is supposed to handle this right? I'm really scratching my head on
this one and its starting to hurt.
TIA
Robert