Contact

'6LfWFyoTAAAAAPbzgiNw7n-YiTsn6l2avnTJYsgA', 'response' => $captcha, 'remoteip' => $_SERVER['REMOTE_ADDR']]; $options = [ 'http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ] ]; $context = stream_context_create($options); $captchaValid = json_decode(file_get_contents($url, false, $context))->success; } catch (Exception $ex) {} } if (!$captchaValid) { outputForm(); } else if (empty($name) || empty($email) || empty($message)) { echo "All fields are required, please try again."; outputForm(); } else { $message = "From: $name ($email)\n\n" . $message; $from="From: " . iconv('UTF-8', 'ASCII//TRANSLIT', $name) . " - danfresneda.com contact form\r\nReply-to: $email"; $subject="Message from contact form"; mail("dan@danfresneda.com", $subject, $message, $from); echo "Email sent!"; } } function outputForm() { ?>