|
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"> 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]
|