html - Radio Buttons to PHP-MySQL -
how can value of radio button "gender selector" (male/female) php? need register.php form. tried googling didnt provide how value of how generate it.
code
<form action = "register.php" method = "post"> <input type="radio" name="sex" value="male">male<br> <input type="radio" name="sex" value="female">female </form>
php:
$sex = $_post['radiobutton=sex'];
on page form:
<form action='register.php' method='post'> <input type='radio' name='sex' value='male'/>male <input type='radio' name='sex' value='female'/>female <input type='submit' name='submit_sex' /> </form>
on register.php:
<?php if (isset($_post['submit_sex'])) echo 'gender ' . $_post['sex']; ?>
Comments
Post a Comment