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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.