ID:               24656
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kapp at bigping dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: UNIX/Linux but probabely all
 PHP Version:      5.0.0b1 (beta1)
 New Comment:

PHP expects an array for that, status->bogus.

http://us2.php.net/manual/en/faq.html.php#faq.html.select-multiple



Previous Comments:
------------------------------------------------------------------------

[2003-07-14 21:25:47] kapp at bigping dot de

Description:
------------
Normally when you have a 'select-array' in a HTML-form 
using the 'multiple="multiple"-Option' you should get 
back an array in PHP.

Unfortunately PHP5 gives back only the last selected 
value instead of an array containing all the selected 
values.

With the supplied HTML/PHP Code you can reproduce this.

Reproduce code:
---------------
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="de" lang="de">
<head>
        <meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
        <title>Untitled</title>
</head>
<body>
<form action="form.html" method="post">
<select name="myvar" multiple="multiple">
<option label="first" value="num1"></option>
<option label="second" value="num2"></option>
<option label="third" value="num3"></option>
<option label="fourth" value="num4"></option>
<option label="fifth" value="num5"></option>
</select>
<input type="submit" />
</form>
<p>
<?php print_r ($_POST); ?>
</p>
</body>
</html>

Expected result:
----------------
I expect to get back an array containing all the 
selected values.

Actual result:
--------------
Actually, only the last selected value is given back.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24656&edit=1

Reply via email to