Here is my form:
<form method="post" enctype="multipart/form-data">
<input type="radio" name="sex" value="male" checked />
<input type="radio" name="sex" value"female"/>
<input type="submit" name="btn">
</form>
$_POST['sex'] = always I see the below output for the radio button:
See = string 'on'
It always gives "on" instead of male or female. This is what I have put in the form.
Am I doing something wrong here?
Please help.
If I use SELECT box, then it works well. But I need to make it work using radio button.
<form method="post" enctype="multipart/form-data">
Male : <input type="radio" name="sex" value="male" checked /><br/>
Female : <input type="radio" name="sex" value="female"/><br/>
<input type="submit" name="btn">
</form>
<?php
error_reporting(0);
echo $_REQUEST['sex'];
?>
Above code is working, Changes
value = female
you forgot to add = sign
<input type="radio" name="sex" value="female"/>
you didn't put equal to sign near female.