use strict; use CGI; use CGI::Carp qw /fatalsToBrowser/; my $out = new CGI; my $button1 = $out->param ( 'button1' ); my $button2 = $out->param ( 'button2' ); if ( $button1 ) { my $url = "/~Plankton/button1.html"; print $out->redirect ( -URL => $url ); } elsif ( $button2 ) { my $url = "/~Plankton/button2.html"; print $out->redirect ( -URL => $url ); } else { print $out->header( 'text/html' ); print <<HTML; <FORM action="twobuttons.pl" method="post"> <input type='submit' name='button1' value='button1'> <input type='submit' name='button2' value='button2'> </FORM> </BODY> </HTML> HTML } # end if button1
| Plankton: 1% Evil, 99% Hot Gas. |
In reply to Re: Two cgi buttons in the same form
by Plankton
in thread Two cgi buttons in the same form
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |