You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ville Skytt� <vi...@office.popsystems.com> on 2000/03/16 09:58:54 UTC
[libapreq] Request params bug ?
Hi,
When parsing request parameters of a POSTed form, the Apache::Request
param() and parms() methods return both the actual parameters from
the form AND the parameters from the form action query string _only_
if the form's enctype is x-www-url-encoded. If the enctype is
multipart/form-data, the action query string params are not there.
Example form:
<FORM method="post"
action="http://myserver.com/myhandler?g1=v1&g2=v2"
enctype="multipart/form-data"
>
<INPUT type="hidden" name="p1" value="v3">
<INPUT type="hidden" name="p2" value="v4">
</FORM>
For this form, parms() returns a hash ref like:
{
p1 => "v3",
p2 => "v4",
}
If the enctype is set to x-www-url-encoded (or removed altogether
since the default is x-www-url-encoded with most browsers), the hash
ref becomes:
{
p1 => "v3",
p2 => "v4",
g1 => "v1",
g2 => "v2",
}
Is this a bug or a feature?
In any case, the thing that the param()/parms() hash contains both
the query string and the form parameters should be documented in
Apache::Request, let alone the different behaviour with different
form enctypes.
BTW, I tested this first with Netscape and then with Konqueror to
make sure that this isn't a browser feature and nearly went crazy
until realized that Konqueror used x-www-url-encoded no matter what
the enctype was set to...
---
Ville Skyttä
Software Designer / Popsystems Oy
Mobile: +358 40 582 4222
Phone: +358 9 2517 2296
Email: ville@popsystems.com