+ 2
How to store value of radio button??
we developed the attendancr system but the value of the radio buttton for the absent and present is not store in data base.how can i store value of radio button and i took the value of the radio button id boolean function 0 and 1.
1 Answer
+ 3
Do not use Boolean, if there is more than 2 ratio choice. You will be in trouble. Like
Gender:
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="female") echo "checked";?>
value="female">Female
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="male") echo "checked";?>
value="male">Male
You can get $gender by
$gender=$_POST["name"];
You can store it as
INSERT INTO table_name (gender) VALUES ('$gender');