You are here: Re: Sending an array from a form « PHP Programming Language « IT news, forums, messages
Re: Sending an array from a form

Posted by Kimmo Laine on 09/25/33 11:37

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.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация