http://www.perlmonks.org?node_id=930910

tarunkhanna has asked for the wisdom of the Perl Monks concerning the following question:

Hi
machine/cgi-bin/abc.cgi?x=5&y=6
I am able to access values of x and y through
use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; my %form = (); print header; print title("Get Form"); print start_html(); print start_form(-method=>'GET',-action=>"abc.cgi?tarun=7&varun=8"); foreach my $p (param()) { print "$p<br>\n"; $form{$p} = param($p); print "$p = $form{$p}<br>\n"; } print submit; print end_form; print end_html;
But I want to modify this statement
print start_form(-method=>'GET',-action=>"abc.cgi?x=7&y=8");
in a way that it calls url with value of x = 7 and y = 8

If I replace word GET with POST, then also it doesn't give proper results on pressing submit button.

Replies are listed 'Best First'.
Re: GET url
by Anonymous Monk on Oct 12, 2011 at 06:28 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: GET url
by Anonymous Monk on Oct 13, 2011 at 08:48 UTC

    Shouldn't you be using hidden form fields? I don't know of any other method of passing query string parametres with a HTML form.