Posted by Richard Lynch on 01/20/05 01:22
Ben Edwards (lists) wrote:
> I know this is not strictly speaking a PHP question but it is to do with
> a PHP app.
>
> I have a form with a number of hidden values in it. After the post
> print_r( $_POST ) shows all the values except these (this is copied from
> 'Show Source' in the browser.
>
> <input type=hidden name=keyField[mb_memberships][0] value=mb_e_id>
> <input type=hidden name=keyValue[mb_memberships][0] value=100000>
> <input type=hidden name=keyField[mb_memberships][1] value=mb_id>
> <input type=hidden name=keyValue[mb_memberships][1] value=1>
>
> Any idea why they wont post?
The *do* POST, but PHP only handles one level of array references in NAME=xxx
You can do something like:
<?php
while (list($keys, $value) = each($_POST['keyField'])){
$keys = explode('][', $keys);
list($key1, $key2) = $keys;
$realKeyField[$key1][$key2] = $value;
}
?>
--
Like Music?
http://l-i-e.com/artists.htm
[Back to original message]
|