Basically when I try this I don't need to click on the captcha to send the message. I just don't understand what in the code allows to bypass the captcha.
Also I'd like to include an error for the user when the captcha is not checked. Sorry if this is a stupid question I'm just trying to learn.
$result = CheckCaptcha($_POST['g-recaptcha-response']);
if ($result['success']($address, $e_subject, $msg, $headers)) {
echo "<h1>Captcha verified</h1>";
echo "<fieldset>";
echo "<div id='success_page'>";
echo "<h1>Email Sent Successfully.</h1>";
echo "</div>";
echo "</fieldset>";
} else {
echo 'ERROR!';
}
if
which runs if the captcha succeeds$result['success']($address
...etc looks like a syntax error to me. Have you got error reporting switched on in php?if(mail($address, $e_subject, $msg, $headers))
withif ($result['success']($address, $e_subject, $msg, $headers))