Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

CGI.pm not seeing params in URL?

by emilford (Friar)
on Nov 15, 2005 at 18:34 UTC ( [id://508717]=perlquestion: print w/replies, xml ) Need Help??

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

Why does CGI.pm not pick up on parameters passed through the URL via my form's action value?
<form action="http://someurl?p=first" method="post">
Now why wouldn't param('p') give me the value first? I get blank values as if the parameters are never set. Is there a work around for this?

Replies are listed 'Best First'.
Re: CGI.pm not seeing params in URL?
by Aristotle (Chancellor) on Nov 15, 2005 at 18:38 UTC

    You can ask for the parameters from the URL explicitly using url_param() instead of param(). There is no way to have them taken into consideration implicitly – that’s a deliberate design decision.

    Makeshifts last the longest.

        Okay, I didn’t know that; but considering that any module can be made to do anything if you patch it, I don’t regard that as pertinent. I certainly wouldn’t want to rely on a feature in a patched module – what if I copy the script to another machine? What if I need to upgrade the module?

        Makeshifts last the longest.

Re: CGI.pm not seeing params in URL?
by jeffa (Bishop) on Nov 15, 2005 at 19:12 UTC

    Don't you think this would be better?

    <form action="http://someurl" method="POST"> <input type="hidden" name="p" value="first" /> ...
    I see no need to mix GET and POST parameters here (or most anywhere).

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: CGI.pm not seeing params in URL?
by thundergnat (Deacon) on Nov 15, 2005 at 19:12 UTC

    Maybe the missing quote around "first" is causing trouble.?

    Never mind. Just having a dopey moment there...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://508717]
Approved by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-16 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found