联系表格不起作用。添加recapcha后显示“此页面无效”

时间:2018-06-06 02:54:30

标签: php html5 recaptcha

我创建了一个联系表单,但联系表单不起作用。单击submit data后,显示屏显示“此页面无法正常工作”,我尝试删除未发送到电子邮件的recapcha数据。

<?
require_once 'recapcha-php/recapchalib.php';
$privatekey = "6Lf5DR4UAAAAACArH2pC8uW4BRSUjBILYQnz_u9f";
$resp = recapcha_check_answer($privatekey, 
$_SERVER["REMOTE_ADDR"], 
$_POST["recaptcha_challenge_fleld"], $_POST["recaptcha_response_fleld"]);
if (!$resp->is_valid) {
    die("ERROR : reCap Wrong");
} else {
    $to_send = 'itsupport@acemsthailand.com';
    $email = $_POST['email'];
    $website = $_POST['website'];
    $phone = $_POST['phone'];
    $message = $_POST['message'];
}
if ($_POST['hotelsystemenquiry']) {
    $hotel = "Website Design Enquiry";
};
if ($_POST['webdesignenquiry']) {
    $webdesign = "Hotel System Enquiry";
}
if ($_POST['optin']) {
    $optins = "Opt in for future offers";
}

$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=UTF-8\r\n";
$header.="From: ".$email;

if (mail($to_send, $email, $website, $phone, $messages_send, $hotelsystemenquiry, 
$webdesignenquiry, $optin, $header)) {
	echo "<h2>send complete</h2>";
} else {
	echo "<h2> send fail</h2>";
}
?>

0 个答案:

没有答案