The way for a radio button to work with only allowing either one or the other option to to assign then the same input name. The values are what is used to determine the choice selected.
Code:
<input type="radio" name="school" value="yes" /><br />
<input type="radio" name="school" value="no" /><br />
With the php, you should check if the post form value is set, and then evaluate one or default to the other according to selection. Also you were assigning a value of "0" to both vars $YES and $NO and then increasing the amount to "1". If you want to store the values in a flat text file instead of a database, first you would need to read the current values of each and then increment that number.
PHP Code:
<?php $YES = ''; // Value from text file $NO = ''; // Value from text file if (isset($_POST['school'])) { if ($_POST['school'] == 'yes') { $YES++; echo '<br />I am glad you like school ' . $YES; } else { $NO++; echo '<br />I am sorry you don\'t like school ' . $NO; } } ?>

__________________
<mgraphic /> - I don't have a solution but I admire the problem.
|