Entry
Using PHP, how can I can check which radio button is checked and store its value in a variable?
Oct 6th, 2000 20:56
Kiwi Ron, Narendra Jain, Naveen Ghanathe, Ben Udall,
Note: name="gender" is the same for both <input.. lines
<form action="register.php" method="post">
...
<input type="radio" name="gender" value="M"> Male
<input type="radio" name="gender" value="F"> Female
...
<br>
<input type="submit">
</form>
register.php may have the following code:
<?
...
echo "Gender: [$gender]\n";
...
?>