#30006 [Bgs]: Incorrect parsing of POST/GET part of HTTP reqest
| From: | rasmus@php.net | Date: | Tue, 07 Sep 2004 08:57:14 +0000 |
| Subject: | #30006 [Bgs]: Incorrect parsing of POST/GET part of HTTP reqest | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-65858@lists.php.net to get a copy of this message | ||
ID: 30006
Updated by: rasmus@php.net
Reported By: knst at mail dot ru
Status: Bogus
Bug Type: Scripting Engine problem
PHP Version: 4.3.7
New Comment:
Your bug was marked bogus because it isn't a bug. PHP was designed to
do it that way. Parsing the query string directly is your only real
option here unless you feel up to patching PHP. I wrote a patch that
changes this behaviour:
http://lerdorf.com/regvar.diff
But you are completely on your own if you apply this. You will be
running a very non-standard PHP and it may break other scripts rather
badly.
Previous Comments:
------------------------------------------------------------------------
[2004-09-07 10:02:45] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
------------------------------------------------------------------------
[2004-09-07 09:52:59] knst at mail dot ru
Description:
------------
I've got a problem while trying to process results of submitting such
kind of a form :
<form method=post >
<input name=vname value="1"><BR>
<input name=vname value="2"><BR>
<input name=vname value="3"><BR>
<input name=vname value="4"><BR>
<input type=submit><BR>
</form>
PHP generates only one variable $vname with value 4
instead of array $vaname[] with 4 elements.
It was impossible to change html of the form. So I had to parse data
read from 'php://input'.
Reproduce code:
---------------
Submittion of
<form method=post >
<input name=vname value="1"><BR>
<input name=vname value="2"><BR>
<input name=vname value="3"><BR>
<input name=vname value="4"><BR>
<input type=submit><BR>
</form>
Expected result:
----------------
value of $vname is
array(
0 => 1,
0 => 2,
0 => 3,
0 => 4)
Actual result:
--------------
value of $vname is 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30006&edit=1