Reply to Re: sending an array in an hidden field

Your name:

Reply:


Posted by Oli Filth on 01/09/06 16:09

nescio said the following on 09/01/2006 14:04:
>>What HTML syntax are you using, and what PHP syntax are you using in
>>your foreach() loop?
>
>
>
> echo "<input type='hidden' name='headersKlant' value='" . $arrayHeaders .
> "'>";

Well, you haven't told us what $arrayHeaders contains, so it's difficult
to see what HTML this will result in. However, I'm pretty sure it won't
work.

The following will work, however:

<FORM action="process.php" method="GET">
<INPUT type="hidden" name="foo[]" value="apple">
<INPUT type="hidden" name="foo[]" value="bison">
<INPUT type="hidden" name="foo[]" value="car">
<INPUT type="submit">
</FORM>

In process.php, $_GET["foo"] will be an array containing those values,
which can be walked using foreach.

Be warned, though, that this HTML syntax is not W3C valid.



--
Oli

[Back to original 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

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