php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #24344 $_POST to create an array when name is repeated
Submitted: 2003-06-26 08:32 UTC Modified: 2003-06-26 08:34 UTC
From: tjedmunds at yahoo dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tjedmunds at yahoo dot com
New email:
PHP Version: OS:

 

 [2003-06-26 08:32 UTC] 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";




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-26 08:34 UTC] derick@php.net
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. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 03:01:31 2024 UTC