Parsing of forms
| From: | Daniele Grillenzoni | Date: | Fri, 15 May 2009 08:25:27 +0000 |
| Subject: | Parsing of forms | ||
| Groups: | php.general php.general php.general | ||
| Request: | Send a blank email to php-general+get-292683@lists.php.net to get a copy of this message | ||
I noticed that php's way to fill $_GET and $_POST is particularly inefficient when it comes to handling multiple inputs with the same name.
This basically mean that every <select multiple> in order to function properly needs to have a name ending in '[]'.
Wouldn't it be easier to also make it so that any element that has more than one value gets added to the GET/POST array as an array of strings instead of a string with the last value?
I can see the comfort of having the brackets system to create groups of inputs easily recognizable as such, while I can overlook the impossibility of having an input literally named 'foobar[]', having to add [] everytime there is a slight chance of two inputs with the same name.
This sounds flawed to me, as I could easily append '[]' to every input name and have a huge range of possibilities unlocked by that.
This can't be right. Or can it?