[英]i'm getting error in php code. trying to access input value in php on wamp server. it gives error as undefined variable but my code is correct
<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"; ?>
The official superglobal's variable name is $_POST
.官方的超全局变量名是
$_POST
。 You cannot replace it with $_post
as it is case-sensitive.您不能用
$_post
替换它,因为它区分大小写。
Shoutout to @Barmar in the comments.在评论中向@Barmar 大喊。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.