I'm writing a mod_perl handler. Nothing exciting, just learning the art and having fun. Only I've hit a little snag-ette...
I have a form like this:
I can get the results of this form easilly using Apache::Request.<form action="" method="post"> <input type="hidden" name="form" value="login"> name <input type="text" name="name"> password <input type="text" name="pass"> </form>
Which gives me:print "\nParameters:\n"; my $apr = Apache::Request->new($r); my @params = $apr->param; if (@params) { for my $param (@params) { print " $param: ", $apr->param($param), "\n"; } } else { print "NO PARAMETERS\n"; }
Which is fine. However, if the URL this is posted to has a GET query string such as http://www.mine.org/handler?name=foo then I get this:Parameters: form: login name: username pass: password
Parameters: name: foousername ## ---- an array form: login pass: password
So, obviously, Apache::Request does not differentiate between GET and POST data. However, I'd like to keep the two seperate. So my question to my fellow monks.... What would be the best way to stop my GET data and my POST data getting mixed up?
I can think of a couple of ways to do it. But I'd like to find a simple, efficient, and elegant solution.
--In reply to Preventing GET and POST from getting mixed-up by xaphod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |