#25262 [Opn->Bgs]: Nested arrays in POST not processed correctly
| From: | pollita@php.net | Date: | Tue, 26 Aug 2003 21:31:54 +0000 |
| Subject: | #25262 [Opn->Bgs]: Nested arrays in POST not processed correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-46715@lists.php.net to get a copy of this message | ||
ID: 25262
Updated by: pollita@php.net
Reported By: jal at ambitonline dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Windows 2000
PHP Version: 4.3.3
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
The form you provided in reproduce code is invalid. Please read the
PHP net manual section on arrays again.
Try something like this:
<form action="strtest2.php" method="post">
<input name="myObject[myVar]" size="40"><br>
<input name="myObject[myArray][0]" size="40"><br>
<input name="myObject[myArray][1]" size="40"><br>
<input type="submit" value="go">
</form>
Previous Comments:
------------------------------------------------------------------------
[2003-08-26 16:20:54] jal at ambitonline dot com
Description:
------------
Nested arrays in a HTML form are not parsed out correctly.
Reproduce code:
---------------
strtest1.php:
<form action="strtest2.php" method="post">
<input name="myObject[myVar]" size="40"><br>
<input name="myObject[myArray[0]]" size="40"><br>
<input name="myObject[myArray[1]]" size="40"><br>
<input type="submit" value="go">
</form>
strtest2.php:
<?php
print_r($_POST);
?>
Expected result:
----------------
Array ( [myObject] => Array ( [myVar] => text1 myArray => Array([0] =>
text2 [1] => text3 ) ) )
Actual result:
--------------
Array ( [myObject] => Array ( [myVar] => text1 [myArray[0] => text2
[myArray[1] => text3 ) )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25262&edit=1