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
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: 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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 12:01:28 2025 UTC