php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24656 Arrays not accepted transmitted by HTTP GET/POST
Submitted: 2003-07-14 21:25 UTC Modified: 2003-07-14 21:47 UTC
From: kapp at bigping dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.0.0b1 (beta1) OS: UNIX/Linux but probabely all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kapp at bigping dot de
New email:
PHP Version: OS:

 

 [2003-07-14 21:25 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-14 21:46 UTC] philip@php.net
PHP expects an array for that, status->bogus.

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

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 11 11:01:27 2024 UTC