Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

inconsistence with Apache2::Request when call "param"

0 views
Skip to first unread message

kwan

unread,
Mar 5, 2010, 11:30:01 AM3/5/10
to
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 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 like this: <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::param
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::Request:param

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 follow the perldoc Apache2::Request, it isn't much infor about the
behavior of the Apache2::Request, as it is mimic the CGI.

Thank

0 new messages