Thursday, October 19, 2017
Home » PHP » How to get checked radio button in php mysql

How to get checked radio button in php mysql

Get the checked radio button in php with check current value of php variable with radio button value iif both are same then checked radio button,

Get the checked radio button

//Example Male is checked 
<?php $gender='M'; ?>
<input type="radio" value="M" name="gender" <?php if($gender=='M') echo "checked"; ?>>Male
<input type="radio" value="F" name="gender" <?php if($gender=='F') echo "checked"; ?> >Female