gpt4 book ai didi

php - $_POST 在 php 5.3.5 中不起作用

转载 作者:行者123 更新时间:2023-12-02 23:58:21 24 4
gpt4 key购买 nike

我正在 PHP 5.3.5 中处理一个页面,并且 $_POST 似乎不包含从我的表单提交的数据。

这是 HTML 文件:

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>

</body>
</html>

这是 PHP 文件:

<html>
<body>

Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.

</body>
</html>

问题是表单值未传递,所以我得到如下输出:

Welcome !You are years old.

而不是这个:

Welcome John!You are 28 years old.

我做错了什么?

最佳答案

尝试<?php var_dump($_POST); ?>看看里面到底有什么。 $_POST 不可能被破坏——它会是别的东西。可能服务器设置禁用了 $_POST。

关于php - $_POST 在 php 5.3.5 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5137598/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com