php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27319 can't use checkboxes sharing same control name
Submitted: 2004-02-19 04:15 UTC Modified: 2004-02-19 04:25 UTC
From: cigorin at pobox dot sk Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.4 OS: Debian GNU/Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cigorin at pobox dot sk
New email:
PHP Version: OS:

 

 [2004-02-19 04:15 UTC] cigorin at pobox dot sk
Description:
------------
When there are more checkboxes within form, which share same control name, it is impossible to get all checked values after form is submitted. The problem holds over regardless what method is used. Normally I'd expect array of values in $_REQUEST superglobal variable instead of single basic value. To be honest I've found the problem in PHP Version 4.3.3 and didn't check if it exists in later versions.

Reproduce code:
---------------
<?php //this is file example.php
  print_r($_REQUEST['records']);
?>

<form method="get" action="example.php">
  <input type="checkbox" name="records" value="A" checked>
  <input type="checkbox" name="records" value="B" checked>
  <input type="submit">
</form>


Expected result:
----------------
Array ( [1] => A [2] => B)

Actual result:
--------------
B

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-19 04:25 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 09:01:34 2025 UTC