Bug #71549 [NEW]: PHP only parses one value from <select multiple> HTML controls
| From: | php2016 at hypertwins dot org | Date: | Mon, 08 Feb 2016 00:40:48 +0000 |
| Subject: | Bug #71549 [NEW]: PHP only parses one value from <select multiple> HTML controls | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-199099@lists.php.net to get a copy of this message | ||
From: php2016 at hypertwins dot org
Operating system: Ubuntu 14.04.3 LTS
PHP version: Next Minor Version
Package: Unknown/Other Function
Bug Type: Bug
Bug description:PHP only parses one value from <select multiple> HTML controls
Description:
------------
This is in PHP 5.5.9-1ubuntu4.14 (not listed in the PHP version
drop-down).
Full phpinfo here: http://vbz.net/phpinfo.php
The test script is currently running here:
http://vbz.net/test/phpbug.php
The problem is that <select multiple> controls can return multiple
values, but PHP seems to ignore all but the last one. When multiple
values are detected, PHP should put them in an array. As it is, <select
multiple> input via $_POST, $_GET, or $_REQUEST is unusable.
This problem does seem to be the same as bug #1117, but:
(a) the only response is that "This is entry #5.9 in the FAQ", and the
FAQ is no longer numbered that way (it's in multiple pages now, and the
5th FAQ page is about "installation"), and...
(b) that report is from 1999 -- surely this problem has been more
properly addressed since then...?
Test script:
---------------
It's 24 lines, so... here:
http://htyp.org/User:Woozle/PHP_multi-select_bug
Expected result:
----------------
The script emits text explaining the problem. $_POST should contain
something like this:
Array
(
[test_select] => (array) : 3 elements
[1] => (string) : 'on'
[2] => (string) : 'on'
[3] => (string) : 'on'
[btnTest] => Yes, this button. Press me.
)
The exact format of the array within the [test_select] element isn't
critical, though I believe the format shown would be consistent with how
checkboxes are handled. What does matter is that all three values are
included, rather than just one of them.
Actual result:
--------------
$_POST contents:
Array
(
[test_select] => 3
[btnTest] => Yes, this button. Press me.
)
Raw POST
header:[test_select=1&test_select=2&test_select=3&btnTest=Yes%2C+this+button.+Press+me.]
--
Edit bug report at https://bugs.php.net/bug.php?id=71549&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71549&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71549&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71549&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71549&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71549&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71549&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71549&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71549&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71549&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71549&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71549&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71549&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71549&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71549&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71549&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71549&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71549&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71549&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71549&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71549&r=mysqlcfg