Reply to Re: SELECT MULTIPLE only one in $_post

Your name:

Reply:


Posted by Oak Hall on 10/09/15 11:23

THANKS!

"Ken Robinson" <kenrbnsn@rbnsn.com> wrote in message
news:1123428555.816519.259610@f14g2000cwb.googlegroups.com...
>
> Oak Hall wrote:
>> Out take from the form, I get all the variables fine from the form, but
>> the
>> Multiple gives only one of the selected ones. Also
>> print_r($_POST["Locations"]); shows only one value. Taking the same form
>> pointing it to another server language (paradox) works fine. Thanks Oak
>>
>>
>> <FORM name="searcher"
>> ACTION="/php/ide/data/frontend.php?lib=mls&cmd=PropertySearchPost"
>> METHOD="POST" >
>> <input type="text" size="4" name="MinAcres" value="">
>> <input type="text" size="4" name="MaxAcres" value=""><BR>
>> <SELECT MULTIPLE NAME="Locations" SIZE="10">
>
> Make the name an array:
> <select multiply name="Locations[]" size="10">
>
>> <OPTION SELECTED VALUE="All">All AREAS
>> <OPTION VALUE=",2459">Braxton
>> <OPTION VALUE="2459">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flatwoods
>> (1)
>> <OPTION VALUE=",2259,2205,2206,2207">Fayette
>> </SELECT>
>> SUBMIT BUTTON
>> </FORM>
>>
>
> Then you're 'foreach' can be written:
>
> foreach ($_POST as $k=>$v) {
> echo $k
> if (is_array($k))
> foreach ($k as $k1=>$v1)
> echo '<br>[' . $k1 . ']' . ' = ' . $v1;
> else echo ' = ' . $v;
> echo '<br>';
> }
>
> Note: code untested.
>
> Ken
>

[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

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