rkmax
rkmax

Reputation: 18133

passing arguments in the URL on POST method

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

Answers (1)

ikegami
ikegami

Reputation: 385657

Use ->url_param instead of ->param to get parameters from the URL when handling a POST request.

Upvotes: 4

Related Questions