<form action="save.php" method="post" >
<label>性别:</label>
<label>男</label>
<input type="radio" value="1" name="sex-man" />
<label>女</label>
<input type="radio" value="2" name="sex-woman" />
</form>
单选框的name必须为统一值,把男和女的name值都改为sex,如下:
<form action="save.php" method="post" > <label>性别:</label> <label>男</label> <input type="radio" value="1" name="sex" /> <label>女</label> <input type="radio" value="2" name="sex" /> </form>