为什么性别提交过去会变成on
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1 align="center">注册页面</h1>
<form action="jieshouyemian.php" method="post">
<table border="1" width="70%" cellpading="0" cellpacing="0" bgcolor="#abcdef" align="center">
<tr>
<td align="right">用户名</td>
<td><input type="text" name="usename" id="" placeholder="请输入合法用户名..."></td>
</tr>
<tr>
<td align="right">密码</td>
<td><input type="password" name="password" id="" placeholder="请输入密码..."></td>
</tr>
<tr>
<td align="right">邮箱</td>
<td><input type="email" name="email" id="" placeholder="请输入邮箱..."></td>
</tr>
<tr>
<td align="right">性别</td>
<td>
<input type="radio" name="sex" id="男">男
<input type="radio" name="sex" id="女">女
<input type="radio" name="sex" id="保密">保密
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="注册"></td>
</tr>
</table>
</form>
</body>
</html>
以下是接收页面
<?php
header("content-type:text/html; charset=utf-8");
echo '用户名:'.$_POST['usename'],'<br/>';
echo '密码:'.$_POST['password'],'<br/>';
echo '邮箱:'.$_POST['email'],'<br/>';
echo '性别:'.$_POST['sex'],'<br/>';

正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 626 份
- 解答问题 4928 个
想要学好Web后端开发的中流砥柱语言,本阶段为你轻松铺就扎实的基础,从前端网页布局的搭建到后台PHP开发,助你从零基础到掌握主流开发语言。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星