How can i pass the radio button values in the url
Posted: Sat Oct 29, 2011 4:58 am
Hi Friends,
My code i am given in below and i want to pass the radio button value in the href link.how can i pass the radio button value also in that href link? I will be grateful if anyone can help me in this regard.
$sql = "SELECT * FROM book";
$result = mysql_query($sql);
while(list($id, $name) = mysql_fetch_row($result)) {
echo "<tr>";
echo "<td>$name</td>";
echo "<td><input type='radio' name='$name' value='amt_1yr'/>1 Year
<input type='radio' name='$name' value='amt_2yr'/>2 Year</td>" ;
echo "<td><a href=\"cart.php?action=add&id=$id&MYRADIOVALUE=CHECKED RADIO VALUE\">Add To Cart</a></td>";
echo "</tr>"; } ?>
</table>
Thanks in advance..
My code i am given in below and i want to pass the radio button value in the href link.how can i pass the radio button value also in that href link? I will be grateful if anyone can help me in this regard.
$sql = "SELECT * FROM book";
$result = mysql_query($sql);
while(list($id, $name) = mysql_fetch_row($result)) {
echo "<tr>";
echo "<td>$name</td>";
echo "<td><input type='radio' name='$name' value='amt_1yr'/>1 Year
<input type='radio' name='$name' value='amt_2yr'/>2 Year</td>" ;
echo "<td><a href=\"cart.php?action=add&id=$id&MYRADIOVALUE=CHECKED RADIO VALUE\">Add To Cart</a></td>";
echo "</tr>"; } ?>
</table>
Thanks in advance..