Combining url parameters from multiple forms

Hi all

I need to combine URL parameters using the following forms:

Product Type <?php $fetchtypes=mysql_query("SELECT * FROM `product_types` ORDER BY id ASC"); while($returnedtypes=mysql_fetch_array($fetchtypes)) { echo "".$returnedtypes['name'].""; } ?> Colour / Finish <?php $fetchcolours=mysql_query("SELECT * FROM `product_colours` ORDER BY id ASC"); while($returnedcolours=mysql_fetch_array($fetchcolours)) { echo "".$returnedcolours['name'].""; } ?>

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

If both forms are going to the same page, combine them and only have one submit button for both forms. That way when the combined forms get submitted via the get method it would show on the url as:

script.php?form1_field=form1_value&form2_field=form2_value

If the two forms need to go to separate pages, you can create a javascript function that’ll createa hidden field on the other form in order to send it with the other. (Ex: if form 1 is going to be sent to destination 1, when a user selects a value in form 2, the function will create a hidden field with the value in form 1 and visa verse. Hope this helps!!!

Sponsor our Newsletter | Privacy Policy | Terms of Service