看了半天代码没有错呀,但$_POST无法实行呀,Undefinedindex。
<!DOCTYPE html>
<html>
<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>注册页面</h1>
<form action="reg.php" method="get">
<table border="1" width="500px" cellpadding="0" bgcolor="#ffd700">
<tr>
<td align="right">用户名</td>
<td><input type="text" name="username" id="" placeholder="请输入合法用户名..."></td>
</tr>
<tr>
<td align="right">密码</td>
<td><input type="password" name="password" placeholder="请输入密码"></td>
</tr>
<tr>
<td align="right">邮箱</td>
<td><input type="email" name="email" placeholder="请输入邮箱"></td>
</tr>
<tr>
<td align="right">性别</td>
<td><input type="radio" name="sex" id="" value="男">男
<input type="radio" name="sex" id="" value="女">女
<input type="radio" name="sex" id="" value="秘密">秘密</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="立即注册"></td>
</tr>
</table>
</form>
</body>
</html>
<?php
//echo '注册成功';
echo '用户名:',$_POST['username'],'<br/>';
echo '密码:',$_POST['password'],'<br/>';
echo '邮箱:',$_POST['email'],'<br/>';
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星