ID:               40354
 Updated by:       [EMAIL PROTECTED]
 Reported By:      andreyra at chtivo dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: Windows 2003 Server
 PHP Version:      5.2.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2007-02-04 17:10:30] andreyra at chtivo dot ru

Description:
------------
I have found strange behaviour with PHP POST/GET arrays. With print_r()
command I have see all contents of array, but if I trying to access to
values of array directly - I have got errors.

I have test this code with:
php5.1.2
php5.2.0
php5.2-win32-200702041530
Apache2.0.58/win32/php5apache2.dll
Apache2.2.3/win32/php5apache2_2.dll
Apache2.2.4/win32/php5apache2_2.dll

And always I have same results.

In my php.ini:
register_globals    =   On
register_long_arrays    =   On
register_argc_argv  =   On
post_max_size       =   512M


Reproduce code:
---------------
<form name="topics" method="post">
<input type="text" name="topic[1]['name']" value="Some text"><br/>
<button onclick="this.form.submit(true);">POST</button>
</form>
<?php
    if (!isset($_POST['topic'])){
      return false;
     };
    if (!is_array($_POST['topic'])){
      return false;
     };
    foreach ($_POST['topic'] as $topic_id=>$arr){
      print_r($arr);
      if (!isset($arr['name'])){
        echo "<br/>\r\nERROR! NAME field is not set!\r\n";
        continue;
       };
      echo 'OK.';
     };

?>

Expected result:
----------------
OK.

Actual result:
--------------
ERROR! NAME field is not set!


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40354&edit=1

Reply via email to