php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #115 Multidimensional array not passed thru a form
Submitted: 1998-02-28 01:07 UTC Modified: 1998-02-28 01:29 UTC
From: merc at iternet dot it Assigned: rasmus (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 3.0a4 OS: Linux
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: merc at iternet dot it
New email:
PHP Version: OS:

 

 [1998-02-28 01:07 UTC] merc at iternet dot it
Hi,
I don't enclose information about the phh.ini
etc, because I really think it doesn't
matter!

This is very easy to reproduce:

This is form.html:

<HTML>
<FORM ACTION="caz.php3" METHOD=POST>
  <INPUT TYPE=HIDDEN NAME=variab[caz4][1] VALUE="1">
  <INPUT TYPE=HIDDEN NAME=variab[caz5][2] VALUE="1">
  <INPUT TYPE=HIDDEN NAME=variab[caz5][3] VALUE="1">
  <INPUT TYPE=HIDDEN NAME=variab[caz5][4] VALUE="1">
  <INPUT TYPE=HIDDEN NAME=variab[caz6][8] VALUE="1">

  <INPUT TYPE=SUBMIT>
</FORM>


  
this is caz.php3:

##################
CAZ.php3
##################
<HTML>
<?
  for($i=0;$i<count($variab);$i++){

    $pp=key($variab);
    echo("CHIAVE: -$pp-<BR>\n");
    next($variab);
  }
?>
####################

And the result is...:

   CHIAVE: -caz4][1-
   CHIAVE: -caz5][2-
   CHIAVE: -caz5][3-
   CHIAVE: -caz5][4-
   CHIAVE: -caz6][8-

The point is that if the passed variable is a 
multidimensional array, the square brackets
are not checked, and the key for the variables
can be... what you read above :-(

A last note: I am writing a quite big project,
and I've a deadline quite near... is this bug
hard to correct?
Or... pheraps, it's my own mistake? :-(

Please, let me know!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-28 01:29 UTC] rasmus
There is no support for multi-dimensional arrays in the GET/POST/COOKIE handling code.  This is
definitely a WishList item for PHP3.1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC