in reply to Attribute values are not passed into the variable using perl cgi?
I have attempted to correct it - and this code should get you the expected "submit=a1" in the querystring on hitting "submit".
Also - naming your sub "header" in a CGI program is a bad idea. I changed it to MyHeader.
uuse strict; use warnings; use DBI; use Getopt::Long; use CGI qw/:all :cgi-lib/; my $CGI_params = Vars(); my %CGI_PARAM = %$CGI_params; my $site = ""; my $site_selected="a1"; $site = "a1"; $site_selected = $CGI_PARAM{'popup'}; $site = $CGI_PARAM{'popup'}; if($site_selected =~ /^\s*$/) { $site = "a1"; $site_selected="a1"; } defined $site or die "usage:$0"; my %map=(a1=>[qw(r_a1_c)],a1=>[qw(r_a2_c)],); show(); sub show{ status(); MyHeader(); } sub status{ my $stm=$site_selected; } sub MyHeader { print start_form(-method=>"GET",-action=>"db.cgi"); print " <br>  <B>Site</B>  "; print popup_menu( -name => 'popup', -value => keys % map, -default => 'value2' ); print "         "; print submit(-type=>"submit",-name=>"submit",-value=>$site); print end_form, "\n"; }
...it is unhealthy to remain near things that are in the process of blowing up. man page for WARP, by Larry Wall
|
|---|