Jump to content

Combining url parameters from multiple forms


petenaylor

Recommended Posts

Hi all

 

I need to combine URL parameters using the following forms:

 

<form id="type_filter" name="type_filter" method="get" action="">

<label for="type_filter"></label>

<select name="type" id="type_filter" style="width: 160px" onchange="this.form.submit();" >

<option value="" selected class="meter-calc-text">Product Type</option>

<?php

$fetchtypes=mysql_query("SELECT * FROM `product_types` ORDER BY id ASC");

while($returnedtypes=mysql_fetch_array($fetchtypes)) {

echo "<option value=\"".$returnedtypes['id']."\"".(($returnedtypes['id']==$_GET['type']) ? ' selected="selected"':'')." >".$returnedtypes['name']."</option>";

}

?>

</select>

</form>

 

<form id="colour_filter" name="colour_filter" method="get" action="">

<label for="colour_filter"></label>

<select name="colour" id="colour_filter" style="width: 160px" onchange="this.form.submit();" >

<option value="" selected class="meter-calc-text">Colour / Finish</option>

<?php

$fetchcolours=mysql_query("SELECT * FROM `product_colours` ORDER BY id ASC");

while($returnedcolours=mysql_fetch_array($fetchcolours)) {

echo "<option value=\"".$returnedcolours['id']."\"".(($returnedcolours['id']==$_GET['colour']) ? ' selected="selected"':'')." >".$returnedcolours['name']."</option>";

}

?>

</select>

</form>

 

At the moment they only send one parameter each. How do I drop down on one and add it to the parameter already on there to give this URL:

 

../stone.php?type=1&colour=1

 

Many thanks

 

Pete

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.