|
Posted by d on 09/26/06 11:37
"Kimmo Laine" <spam@outolempi.net> wrote in message
news:dqj4to$g7f$1@phys-news4.kolumbus.fi...
> Kimmo Laine <antaatulla.sikanautaa@gmail.com.NOSPAM.invalid>
> "d" <d@example.com> kirjoitti
> viestissδ:Hb6zf.2613$wl.1928@text.news.blueyonder.co.uk...
>> "Kimmo Laine" <spam@outolempi.net> wrote in message
>> news:3g5zf.3543$wM4.541@reader1.news.jippii.net...
>>> "Mike" <someone@microsoft.com> wrote in message
>>> news:Mv4zf.7033$8r1.4445@trndny01...
>>>> Hello,
>>>> How do I send an array from a form to another php page?I want to
>>>> bundle up some data from form fields in an array and send them together
>>>> like that. I must be missing something?
>>>> Thanks
>>>> Mike
>>>
>>>
>>> <html><body>
>>> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="get">
>>> <input type="text" name="myarray[]" value="you">
>>> <input type="text" name="myarray[]" value="mean">
>>> <input type="text" name="myarray[17]" value="like">
>>> <input type="text" name="myarray[dog]" value="this?">
>>> <input type="submit">
>>> </form>
>>> <?php print_r($_GET['myarray']); ?>
>>> </body></html>
>>
>> serialize is a lot easier ;)
>>
>
>
> Sure it is, but I understood that the data for the array would come from
> the fields of the form, while using serialize, the data should already be
> available at the script, serialized there and echoed to a value a form
> field. Depending on what the original poster really asked, both of these
> could be valid solutions. I just assumed that he wanted the values of the
> array from the form fields, of course I could be wrong.
Well noticed :) I guess his question was a bit ambiguous - your solution is
exactly what he needs if he wants to populate an array directly from a form.
Makes me wonder why people don't read the documentation ;)
> --
> SETI @ Home - Donate your cpu's idle time to science.
> Further reading at <http://setiweb.ssl.berkeley.edu/>
>
Navigation:
[Reply to this message]
|