简体   繁体   English

我在 php 代码中遇到错误。 试图访问 wamp 服务器上 php 中的输入值。 它作为未定义的变量给出错误,但我的代码是正确的

[英]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"; ?>
i am getting the error message that the variable is not found but my code is correct how to resolve this issue 我收到错误消息,提示找不到变量,但我的代码是正确的 如何解决此问题

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM