Partners & Affiliates














[PHP-DEV] Bug w/ multi-dimensional form elements and file uploads? From: Sascha Schumann (sascha <email protected>)
Date: 01/19/01

    Hi,

    please consider this part of a form:

      <input name="Data[user][foo]" type="text">
      <input name="Data[user][bar]" type="file">

    The file upload code adds Data[user][foo] properly to
    HTTP_POST_FILES. But then, it tries to add variables like
    these:

    Data[user]_name[bar]
    Data[user]_size[bar]
    Data[user]_type[bar]

    php_register_variable_ex() decides then to nuke the existing
    Data[user] entry from the HTTP_POST_FILES hash (because it
    sees _name instead of [.*]), so that the previously set
    Data[user][foo] entry becomes inaccessible.

    Questions:

    1. Is this supposed to work at all?
    2. What do you think of adding Data_name[user][bar] instead
        of the above form?

    - Sascha

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>