原谅我,因为这可能有一个非常简单的解决方案,我只是很缺乏经验。关于HTML5主题的联系表格问题
我使用Massive HTML5主题,无法让我的联系表单正常工作。我以为我按照指示行事,但当点击SUBMIT时仍然没有任何反应。
Send Message
// Note: filter_var() requires PHP >= 5.2.0
if (isset($_POST['name']) && isset($_POST['email']) && isset($_POST['subject']) && isset($_POST['comments']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
// detect & prevent header injections
$mailTest = "/(content-type|bcc:|cc:|to:)/i";
foreach ($_POST as $key => $val) {
if (preg_match($mailTest, $val)) {
exit;
}
}
$headers = 'From: ' . $_POST["name"] . '' . "\r\n" .
'Reply-To: ' . $_POST["email"] . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$success = mail("[email protected]", $_POST['subject'], $_POST['comments'], $headers);
// Replace with your email
if ($success) {
?>
Success! Message has been sent successfully.
}
}
感谢您的帮助。
+0
什么是您的网址? –