|
Posted by dude on 12/18/53 11:50
> try:
> foreach($_GET['OS'] as $i => $val)
> echo $i . ": " . $val . "<br>";
>
> By the way, I think you're missing the attribute MULTIPLE from the select if
> you want to be able to select multiple items. It should be
> <select name="OS[]" size="5" multiple>
>
> or if you're using xhtml,
> <select name="OS[]" size="5" multiple="multiple">
i did set multiple, and the foreach and the echo result is:
if all the items in the list are selected :
0: 1
1: 2
2: 3
3: 3
if second selected then the echo will be: 0: 1
ok, i can work this way, but can it echo values i mean selected string,
like Windows, Linux, ... , not 0:1, 0:2, etc ...
is it possible ?
eccept if ... or switch condition
foreach($_GET['OS'] as $i => $val)
if($i == 0 && $val == 1)
echo "Windows <br>";
if($i == 0 && $val == 2)
echo "Linux <br>";
... etc
this is too complicated, what if i have 40 items in the list :)
[Back to original message]
|