<html>
<head>
</head>
<body>
<form action="add.php" method="post" >
<input type="text" name="user" />
<input type="number" name="age" />
<input type="submit" />
</form>
</body>
</html>
======================================================================================================
//php code
<?php
$n=$_post['user'];
$a=$_post['age'];
echo "Hello $n your age is $a";
?>
官方超级全局变量的名称为$_POST
。您无法将其替换为$_post
,因为它区分大小写。
在评论中大声疾呼@Barmar。