php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25421 $_POST doesn't show the value of select form field when multiple=true
Submitted: 2003-09-07 21:01 UTC Modified: 2003-09-30 13:26 UTC
From: khalid_kary at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.3 OS: Linux
Private report: No CVE-ID: None
 [2003-09-07 21:01 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-08 08:39 UTC] sniper@php.net
Works fine for me, you must be doing something wrong.


 [2003-09-30 11:09 UTC] khalid_kary at hotmail dot com
I have found that I (by mistake) invoked stripslashes on all the elements of $_POST.


stripslashes() shouldn't corrupt the array in $_POST['ids'](?)
 [2003-09-30 13:26 UTC] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 23:01:30 2024 UTC