this question has actually 2 parts
i have some vars: $cat = 41; $cat = 2; $cat = 3; and i want to be able to pass more than one as an array here $next_page .= "?cat= [] "; so that the final get to look like this
http://www.xxx.com/csxxx.php?&cat=3, 41
what i actually want to do is to pass this integers to a drop down menu as a multiple selection.
for that i got this function:
<?
function display($cat, $name)
{?>
<select name="<?=$name?>">
<option value=<?php if ($cat == "2" ) {echo"2 selected";} else {echo"0";}?>> 2</option>
<option value=<?php if ($cat == "41") {echo"41 selected";} else {echo"41";}?>>41</option>
<option value=<?php if ($cat == "3") {echo"3 selected";} else {echo"1";}?>>3</option>
<?
if ($cat == 'xx') // any
{
print "<option value=\"\" selected>Any</option>";
}
?>
</select>
<?
}
?>
any ideas?
thanks
If you want use only native functional, you must change code of dropdown to this look
add to name “[]” and multiple option
In this case you have url page?cat[]=1&cat[]=2…
And available in the $_GET[‘cat’] as an array.
If you need comma separated “cat” in url you must use javascript.
Exaple for jQuery.