php联系表单 - 语法错误

时间:2013-07-01 10:14:36

标签: php html syntax-error

嗨,大家好,有人可以看看以下内容,我不明白为什么我收到错误。 HTML看起来像这样

<form action="form.php" method="post"> <label for="name">Name:</label> <input type="text" name="name" id="name" required placeholder="Name" /> <label for="email">Email:</label> <input type="email" name="email" id="email" required placeholder="email@example.com" /> <label for="website">Website:</label> <input type="url" name="website" id="website" required placeholder="http://www.example.com" /> <label for="message">Message:</label> <textarea name="message" id="message" required></textarea> <input type="submit" value="Send Message" /> </form>

然后我的form.php,就像这样。错误在第16行

<?php
$name=$HTTP_POST_VARS['name'];
$email=$HTTP_POST_VARS['email'];
$subject=$HTTP_POST_VARS['subject'];
$message=$HTTP_POST_VARS['message'];

$headers = "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/plain; charset=utf-8\r\n";

$headers .= "From: $name \r\nReply-to : $name \nX-Mailer:PHP”;

$subject=”$subject”;
$destinataire=”sean@seankonig.co.za”;
$body=”$message”;
**if (mail($destinataire,$subject,$body,$headers)) {**
echo “It works”;
} else {
echo “Problem”;
}
?>

我真的很感谢你的帮助。

1 个答案:

答案 0 :(得分:3)

您使用的是智能引号,请使用常规引号"替换它们。