我正在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.
我在做什么错?
您确定您已经发布过吗?你能看到邮件正文与标题中的信息? – alex 2011-02-28 02:13:28
如果您在welcome.php上查看源代码,您是否看到php或只是空白? – 2011-02-28 02:16:34
它返回空白页面 – naji 2011-02-28 02:42:23