#24344 [Opn->WFx]: $_POST to create an array when name is repeated
| From: | derick@php.net | Date: | Thu, 26 Jun 2003 13:34:49 +0000 |
| Subject: | #24344 [Opn->WFx]: $_POST to create an array when name is repeated | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-42541@lists.php.net to get a copy of this message | ||
ID: 24344
Updated by: derick@php.net
Reported By: tjedmunds at yahoo dot com
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.3.2
New Comment:
We can not do this because it would break BC for users who rely on PHP
using the last value set for a specific variable name.
Previous Comments:
------------------------------------------------------------------------
[2003-06-26 08:32:35] tjedmunds at yahoo dot com
Description:
------------
It would be very useful if PHP would automatically create an array for
$_POST when the same input field name occurs multiple times in a
POST'ed form. This can be accomplished by putting [] after the name in
the form but that is not always an option for every application (such
as wrapping a Perl cgi or writing a 'remote' browser).
$HTTP_RAW_POST_DATA is more useful but is not always populated without
php.ini file changes. The result is that the default behaviour is to
discarded POST'ed data as it is overwritten with the last value.
It would be preferable to have the following:
$_POST[nonuniquename][0] = "the first occurence";
$_POST[nonuniquename][1] = "the second occurence";
...
$_POST[nonuniquename][n] = "the nth occurence";
instead of:
$_POST[nonuniquename] = "the nth occurence";
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24344&edit=1