K
kwan
Hello,
I wrote a mod_perl to check some of the value that users select. The
script will generate a form according to the selection from the user.
There are three forms that are dynamically generated according to the
selection,
in the "display form", there are links to the "add form" and
"modify form".
in the "add form", there are links to the "display form" and
modify form".
in the "modify form", there are links to the display form"
and "add from".
In each link, it is like this:
http://hostname:80/mainform?selection=display
http://hostname:80/mainform?selection=modify
http://hostname:80/mainform?selection=add
within the form, I also have the submit form for user to submit the
content to the server.
the submit form is: <input type="submit" name="selection"
value='Add Content'>
Before, when I use "use CGI" package I can use "param", and the form
will be generate and query according to the user submit.
Code:
my $selection = lc (param('selection'));
if ($selection eq "add content") { }# work with CGI, but
not with Apache2::Request:aram
elsif ($selection eq "modify") {} # work both
elsif ($selection eq "add") {} # work both
elsif ($selection eq "display"){} # work both
elsif ($selection eq "modify content"){} # work with CGI,
but not with Apache2::Requestaram
when using CGI, I can get the "param" work according to the user
selection. However, when I replace to the following code by using
Apache2::Request, when user select modify form, and submit the form.
the $r->param('selection') is failed to identify the "modify content"
value.
my $rq = new Apache2::Request($r);
my $selection = lc ($rq->param('selection'));
I've followed the perldoc Apache2::Request, it isn't much infor about
the
behavior of the Apache2::Request, as it is mimic the CGI.
Thank
I wrote a mod_perl to check some of the value that users select. The
script will generate a form according to the selection from the user.
There are three forms that are dynamically generated according to the
selection,
in the "display form", there are links to the "add form" and
"modify form".
in the "add form", there are links to the "display form" and
modify form".
in the "modify form", there are links to the display form"
and "add from".
In each link, it is like this:
http://hostname:80/mainform?selection=display
http://hostname:80/mainform?selection=modify
http://hostname:80/mainform?selection=add
within the form, I also have the submit form for user to submit the
content to the server.
the submit form is: <input type="submit" name="selection"
value='Add Content'>
Before, when I use "use CGI" package I can use "param", and the form
will be generate and query according to the user submit.
Code:
my $selection = lc (param('selection'));
if ($selection eq "add content") { }# work with CGI, but
not with Apache2::Request:aram
elsif ($selection eq "modify") {} # work both
elsif ($selection eq "add") {} # work both
elsif ($selection eq "display"){} # work both
elsif ($selection eq "modify content"){} # work with CGI,
but not with Apache2::Requestaram
when using CGI, I can get the "param" work according to the user
selection. However, when I replace to the following code by using
Apache2::Request, when user select modify form, and submit the form.
the $r->param('selection') is failed to identify the "modify content"
value.
my $rq = new Apache2::Request($r);
my $selection = lc ($rq->param('selection'));
I've followed the perldoc Apache2::Request, it isn't much infor about
the
behavior of the Apache2::Request, as it is mimic the CGI.
Thank