Hi all i run a small website for a friend, i used to have a form to email contact area on my site that included googles recaptcha, i spent ages trying to get it to work with my minimal knowledge of PHP and was successful unfortunately after losing the files completely i decided to remake it using the new recaptcha 2.0.
now i am at the point where i have the captcha working but have no idea how make it send out an email. is it possible to make it send the email by adding specific code just before the echo ‘Thanks for posting comment.
’; line in my PHP?
i really need a easy to understand piece of advice or code snippet from anyone kind enough to help, ive tryed a number of tutorials and im not getting anywhere. please help.
CONTACT.HTML
[php]
FORM.PHP
[php]<?php
$email;$comment;$captcha;
if(isset($_POST[‘email’])){
$email=$_POST[‘email’];
}if(isset($_POST[‘comment’])){
$comment=$_POST[‘comment’];
}if(isset($_POST[‘g-recaptcha-response’])){
$captcha=$_POST[‘g-recaptcha-response’];
}
if(!$captcha){
echo ‘
Please check the the captcha form.
’;exit;
}
$secretKey = “REMOVEDINTHISEXAMPLE”;
$ip = $_SERVER[‘REMOTE_ADDR’];
$response=file_get_contents(“https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=”.$ip);
$responseKeys = json_decode($response,true);
if(intval($responseKeys[“success”]) !== 1) {
echo ‘
failure- Under maintenance
’;} else {
echo ‘
Thanks for posting comment.
’;}
?>[/php]