addUser.php:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2>添加用户</h2>
<form action="doAction.php" method="post">
<table border="1" cellspacing="0" cellpadding="0" bgcolor="#ABCDEF" width="50%">
<tr>
<td>用户名</td>
<td><input type="text" name="user_name" id="" placeholder="请输入合法用户名" required="required"/></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="pass_word" id="" placeholder="请输入密码" required="required"/></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="number" name="age" id="" min="1" max="150" placeholder="请输入年龄" required="required"/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="添加用户"/></td>
</tr>
</table>
</form
</body>
</html>
doAction.php:
<?php
header("content-type:text/html;charset:utf-8");
var_dump($_POST);
为什么抓不到值呢?
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h2>添加用户</h2>
<form action="doAction.php" method="post">
<table border="1" cellspacing="0" cellpadding="0" bgcolor="#ABCDEF" width="50%">
<tr>
<td>用户名</td>
<td><input type="text" name="user_name" id="" placeholder="请输入合法用户名" required="required"/></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="pass_word" id="" placeholder="请输入密码" required="required"/></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="number" name="age" id="" min="1" max="150" placeholder="请输入年龄" required="required"/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="添加用户"/></td>
</tr>
</table>
</form
</body>
</html>
doAction.php:
<?php
header("content-type:text/html;charset:utf-8");
var_dump($_POST);
为什么抓不到值呢?