#23197 [Opn->Bgs]: $_POST / $_GET incorrect
| From: | rasmus@php.net | Date: | Mon, 14 Apr 2003 14:04:26 +0000 |
| Subject: | #23197 [Opn->Bgs]: $_POST / $_GET incorrect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37645@lists.php.net to get a copy of this message | ||
ID: 23197
Updated by: rasmus@php.net
Reported By: Guus-Leeu at gmx dot de
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux 2.4.18
PHP Version: 4.3.2RC1
New Comment:
Use:
<select name="preferredLanguage[]" multiple>
Previous Comments:
------------------------------------------------------------------------
[2003-04-14 03:35:35] Guus-Leeu at gmx dot de
Setup of PHP4.3.2.RC1 (CVS copy of that branch)
./configure --with-apxs=/usr/local/apache/bin/apxs --with-openssl
--with-ldap=/usr/local/openldap --enable-mysql
--with-mysql=/usr/local/mysql --prefix=/usr/local/php4_cvs
Suppose I have
<form action="my.php" method="post">
<select name="preferredLanguage" multiple>
<option value="1">English</option>
<option value="2">German</option>
<option value="3">Dutch</option>
</select>
</form>
Suppose, the user selects German and Dutch by CTRLclicking
the entries.
The array $_POST ends up having
$_POST["preferredLanguage"] == "3"
rather than
$_POST["preferredLanguage"][0] == "2" &&
$_POST["preferredLanguage"][1] == "3"
The $_QUERY_STRING (if using method="GET") contains both
values, but the $_GET array is not set correctly.
I suppose, this has to do with the fact that values are just
registered one after the other, as is the case in
php_std_post_handler(), whereas it would be nice to have a
prelookup if the key already exists and then build an array for its
value.
I'm not sure where I can fix this, but if you give me the right
pointers, I'm sure able to do it myself.
I'ld suggest building an array for the key's value that has:
["count"] number of elements
[0] first value
[1] second value
etc.
Or did I miss something in my compilation?
Cheers,
Guus
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23197&edit=1