|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-14 21:46 UTC] philip@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 11 22:00:01 2025 UTC |
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.