From:             thijs at toltech dot nl
Operating system: Gentoo Linux
PHP version:      5.0.5
PHP Bug Type:     Variables related
Bug description:  Arrays from form get send over as string instead of array

Description:
------------
By using form you can send Arrays over to the next page with the
name="var_name[]" method.

However, doing this will result in that the $_POST['var_name'] will
contain the string 'Array' all the time, no matter what is really send
in.

(Note: this also happend to me in php5.1.0-b3, gentoo forced me to
downgrade but I think it is also in php5.1.0-rc1, would be glad if anyone
can check this for me)

Reproduce code:
---------------
<select name="color[]">
<option value="*">All</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
<option value="orange">Orange</option>
<option value="yellow">Yellow</option>
</select>

and on the next page in php code:

<?php
print_r($_POST);
?>



Expected result:
----------------
The expected result is (assuming you selected 'Green' and 'Red':

Array 
(
    [color] = Array 
    (
        [0] = red
        [1] = green
    )
)

Actual result:
--------------
while will produce (no matter what you select):

Array 
(
    [color] = Array
)

-- 
Edit bug report at http://bugs.php.net/?id=34594&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34594&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34594&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34594&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34594&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34594&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34594&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34594&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34594&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34594&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34594&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34594&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34594&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34594&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34594&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34594&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34594&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34594&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34594&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34594&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34594&r=mysqlcfg

Reply via email to