#25421 [Bgs->Opn]: $_POST doesn't show the value of select form field when multiple=true
| From: | khalid_kary at hotmail dot com | Date: | Tue, 30 Sep 2003 15:09:17 +0000 |
| Subject: | #25421 [Bgs->Opn]: $_POST doesn't show the value of select form field when multiple=true | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-48325@lists.php.net to get a copy of this message | ||
ID: 25421
User updated by: khalid_kary at hotmail dot com
Reported By: khalid_kary at hotmail dot com
-Status: Bogus
+Status: Open
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 4.3.3
New Comment:
I have found that I (by mistake) invoked stripslashes on all the
elements of $_POST.
stripslashes() shouldn't corrupt the array in $_POST['ids'](?)
Previous Comments:
------------------------------------------------------------------------
[2003-09-08 08:39:52] sniper@php.net
Works fine for me, you must be doing something wrong.
------------------------------------------------------------------------
[2003-09-07 21:01:17] khalid_kary at hotmail dot com
Description:
------------
$_POST doesn't list the value of a <select> form field where
multiple="true", while $_REQUEST does it just fine, $_POST only puts
the string "Array" in place of the form field's name.
Reproduce code:
---------------
HTML form:
<form action="something.php" method="post">
<select multiple="true" name="ids[]">
<option value="1">first option</option>
<option value="2">second option</option>
</select>
</form>
PHP script (something.php):
<?php
print_r($_POST['ids']);
?>
Output:
Array
Expected Ouput:
Array ([0] => 1, [1] => 2)
Another PHP Script:
<?php
print_r($_REQUEST['ids']);
?>
Output:
Array ([0] => 1, [1] => 2)
$_POST -therefore- is doing the wrong thing.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25421&edit=1