|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22251 wrong parameters in $_GET/$_PUT tables
Submitted: 2003-02-17 09:56 UTC Modified: 2003-02-18 06:54 UTC
From: kr at bpm dot pl Assigned:
Status: Not a bug Package: *Programming Data Structures
PHP Version: 4.2.3 OS: RH8.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kr at bpm dot pl
New email:
PHP Version: OS:


 [2003-02-17 09:56 UTC] kr at bpm dot pl
apache 2.0.40
web browser: file.php?par=1&par=2&par=3

echo count($_GET); // 1 
echo $_GET["par"]; // 3(string) not table with values:1,2,3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-17 11:04 UTC]
A correct url of file.php?par[]=1&par[]=2&par[]=3
would give you the expected result..

 [2003-02-17 11:33 UTC] kr at bpm dot pl
This path: file.php?par[]=1&par[]=2&par[]=3 is correct for  my PHP.
But my opinion url: file.php?par=1&par=2&par=3 is correct too. 
Submit form with e.g.
<input "checkbox" name="par" value="1">
<input "checkbox" name="par" value="2">
<input "checkbox" name="par" value="3">
 [2003-02-17 11:47 UTC]
Again, append that [] in the name:

<input "checkbox" name="par[]" value="1">

And no, we will not change this.

 [2003-02-18 01:30 UTC] kr at bpm dot pl
I understand you Sniper :-) but you don't understand me.
Is this line correct? <input "checkbox" name="par" value="1"> Yes!!! It is correct! I can call checkbox "par"
and I don't must call it "par[]". If "it is correct", the result of PHP action ($_GET/$_PUT['par']) should be correct to!
When I call chackbox "par[]" it is simple crossing over the problem but not founding real solution.
 [2003-02-18 06:54 UTC]
No, we understand you perfectly.  However, this is a choice that PHP has made, and it's not going to change.

<input "checkbox" name="par" value="1"> is correct for PHP oly if you wish to return a single result; if you want multiple results, PHP requires you to use multiple <input "checkbox" name="par[]" value="..."> elements, *with* the [] array-designator on the names.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 16:01:29 2024 UTC