Bug #16195 Updated: GET/POST-vars does not work according to standards
| From: | markonen@php.net | Date: | Tue, 09 Jul 2002 15:34:58 +0000 |
| Subject: | Bug #16195 Updated: GET/POST-vars does not work according to standards | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13620@lists.php.net to get a copy of this message | ||
ID: 16195
Updated by: markonen@php.net
Reported By: mail4news@mailme.dk
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: All
PHP Version: 4.1.2
New Comment:
The HTML 4 and XHTML standards in fact do support the []
characters in input field names.
See:
http://www.w3.org/TR/html401/interact/forms.html#h-17.4
for
HTML 4.01
and
http://www.w3.org/TR/xhtml-modularization/
abstract_modules.html#s_extfor for XHTML 1.1
Previous Comments:
------------------------------------------------------------------------
[2002-06-08 10:50:13] bigredlinux@yahoo.com
I think it has become a well adopted standard to use the [] in the
names to specify an array or list. I can't think of a browser or
language that does not support this.
------------------------------------------------------------------------
[2002-03-20 18:43:14] mail4news@mailme.dk
According to (X)HTML standards you are allowed to have more than one
variable with the same name in a form. One example of this is a listbox
where the user can select multiple items.
The common solution to this is to use "[]" after the name of the
variable so that PHP treats it as an array. Ex: <select name="foo[]">
According to the standards, these characters are not allowed in the
name. It is unlikely, but not probable, that you may risk
incompatibillity problems with some browsers. Even though most browsers
accepts it, I think PHP should follow the standards.
One solution:
I haven't seen the source code, so this may be more complicated to fix
than I think. When parsing the data from the request there should be a
check in the code that checks if it has recieved a variable with the
same name. If so, it should change the original variable to an array
and add the new variable in that array.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16195&edit=1