php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1633 -enable-track-vars and arrays
Submitted: 1999-06-30 10:59 UTC Modified: 1999-06-30 12:04 UTC
From: oh3mqu at teraflops dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.9 OS: Linux and Solaris
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: oh3mqu at teraflops dot com
New email:
PHP Version: OS:

 

 [1999-06-30 10:59 UTC] oh3mqu at teraflops dot com
So...


If I have a program like this

-----  clip here  -----  
<?php

 $x[0][0]=1;
 $x[0][1]=1;
 $x[1][0]=1;
 $x[1][1]=1;

 while($y=each($x))
  echo "'$y[0]' - '$y[1]'<br>\n";

?>
-----  clip here  -----

It works correctly and prints
  '0' - 'Array'
  '1' - 'Array'


But if I have HTML-form like this

<form action=foo.phtml>
  <input type=checkbox name=x[0][0]>
  <input type=checkbox name=x[0][1]>
  <input type=checkbox name=x[1][0]>
  <input type=checkbox name=x[1][1]>
  <input type=submit>
</form>

And foo.phtml is

<?php
  while($y=each($x))
    echo "'$y[0]' - '$y[1]'";
?>

This works different way and it prints
 '0][0' - '1'
 '0][1' - '1'
 '1][0' - '1'
 '1][1' - '1'



This is tested with linux and solaris apache+php 3.0.6/7/9

-- 
Ari

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-30 12:04 UTC] jim at cvs dot php dot net
You can't use multi-dimensional arrays in form data. This
is covered in more than one other bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC