You are here: Re: [PHP] Problem with hidden form input values « PHP « IT news, forums, messages
Re: [PHP] Problem with hidden form input values

Posted by Jochem Maas on 01/20/05 01:55

Richard Lynch wrote:
> 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

not true (he does mention that print_r() does not show these values,
given that he has run print_r() on $_POST its fair to assume that he
would have noticed if his var were only 'half there' so to speak),

here's a url format I use in a generic CMS thingy:

?a=512&e[n]=xxx&e[f][kf][MY_ID]=1&e[f][kf][YOUR_ID]=2&e[f][n]=xyz&e[f][kf][CHILD_ID]=3

the only problem I have is that I can max out the number of bytes
excepted in a GET request, I don't destiguish between POST/GET and it
works just as well via a post form.

arbitrary $_POST dump (simple):
Array
(
[a] => 512
[e] => Array
(
[n] => compoundpart
)

[PART_ID] =>

>
> You can do something like:
> <?php
> while (list($keys, $value) = each($_POST['keyField'])){
> $keys = explode('][', $keys);
> list($key1, $key2) = $keys;
> $realKeyField[$key1][$key2] = $value;
> }
> ?>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация