<?php
/*random1 is a randomly generated number*/
if($_GET){
/*picking 'i' using $_GET and doing a query in mysql*/
/*Unable to pick the value from select box, using either $_GET or $_POST*/
}
else{
/*some other query*/
}
?>
<a href="?i=<?php echo $random1;?>"> <span> Roll the dice!</span></a>
<span>Categories: </span>
<select name="cat_area" >
<option value="all">All</option>
<option value="all">One</option>
<option value="all">Two</option>
<option value="all">three</option>
</select>
My problem is: When I click roll the dice, it knows the value of i but how to send the value of one of the ‘options’ from the select box along with the i. I am a newbie in php. Tell me if I am going wrong in using wrong kind of input for this.
First of all, you currently have the same
valuefor each option, so you won’t be able to tell which they selected anyway.You will also want to add the random
ias a hidden field.Are you happy with how to create forms?
If you specifically want it to be an
<alink then you’re going to need aonChangetype Javascript function on the select to modify the link. Does it need to be a link?