using checked and unchecked values from radio buttons
Posted: Mon Jun 02, 2003 3:27 pm
Hi
what i have is a series of questions and 1 radio button next to each one. So i need to be able to tell whether a button is checked or unchecked. i thought this would be as easy checking to see if its NULL but it isnt so.
any tips would be appreciated. my code looks a bit like
and the form
Thanks
what i have is a series of questions and 1 radio button next to each one. So i need to be able to tell whether a button is checked or unchecked. i thought this would be as easy checking to see if its NULL but it isnt so.
any tips would be appreciated. my code looks a bit like
Code: Select all
<?php
if(isset($_POST['submit'])){
if ($_POST['first_question'] = true && $_POST['second_question'] = true){
echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');
}
else
echo ' sorry you are not suitable to receive our product';
}
?>Code: Select all
<form name="form1" method="post" action="<?php echo $PHP_SELF?>">
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
<tr>
<td class="row3" colspan="3" height="25" valign="middle"> Please Confirm All
Statements </td>
</tr>
<tr>
<td class="row1" width="95%"> Please confirm 1st question
</td>
<td class="row2" width="5%">
<input type="radio" name="first_question" value="0">
</td>
</tr>
<tr>
<td class="row1">Please confirm second question
<td class="row2">
<input type="radio" name="second_question" value="0">
</td>
</tr>
<tr>
<td class="row1" colspan="2"> <input type="submit" value="Confirm" name="submit"></td>
</tr>
</table> </form>