【发布时间】:2015-09-16 15:02:57
【问题描述】:
大家好,我正在学习 PHP,我已经在我的机器上下载了 XAMPP。我处理表格有问题。我使用 HTML 创建了一个表单,并按照教程中的要求将其存储在 xampp 文件夹中的 htdocs 中。当我在 HTML 中打开表单时,它可以正常工作,但是当我单击提交时,它将无法正常工作。这是按下 SUBMIT 时的输出:
$comments
We will reply to you at $email.
\n" ?>
这是我的 PHP 代码:
<!DOCTYPE html>
<head>
<title>Form feedback</title>
</head>
<body>
<?php #Script 2.2 - handle_form.php
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['comments'];
echo "<p>Thank you, <b>$name</b>,for the following comments:<br /><tt>$comments</tt></p>
<p>We will reply to you at <i>$email</i>.</p>\n"
?>
</body>
</html>
【问题讨论】:
-
PHP 没有被解析。
-
我应该如何解决这个问题?我把 放在最后。我没有忘记这一点。