Reputation: 18133
I'm trying to pass arguments in the URL
example:
// client side
URL: index.pl?action=view_user
METHOD: GET
#perl side
my $Q = CGI->new;
print $Q->param('action');
return me view_user
but when try post by example on a form:
// client side
URL: index.pl?action=save_user
METHOD: POST
FORM:
username: test
#perl side
my $Q = CGI->new;
print $Q->param('action'), "-", $Q->param('username');
return me -test
. why the param on url is blank?
Upvotes: 2
Views: 388
Reputation: 385657
Use ->url_param
instead of ->param
to get parameters from the URL when handling a POST request.
Upvotes: 4