Skip to content

Instantly share code, notes, and snippets.

@Nelrohd
Created May 14, 2015 13:32
Show Gist options
  • Save Nelrohd/4f0a31f03a313be9e8a2 to your computer and use it in GitHub Desktop.
Save Nelrohd/4f0a31f03a313be9e8a2 to your computer and use it in GitHub Desktop.
<?php
// grab recaptcha library
require_once "recaptchalib.php";
// your secret key
$secret = "6LcePAATAAAAABjXaTsy7gwcbnbaF5XgJKwjSNwT";
// empty response
$response = null;
// check secret key
$reCaptcha = new ReCaptcha($secret);
if ($_POST["g-recaptcha-response"]) {
$response = $reCaptcha->verifyResponse(
$_SERVER["REMOTE_ADDR"],
$_POST["g-recaptcha-response"]
);
}
if ($response != null && $response->success) {
// ENVOI TON EMAIL PUIS AFFICHE LA REPONSE VALIDEE DU FORMULAIRE ICI
} else {
?>
<!-- AFFICHE TON FORMULAIRE HTML CONTACT ICI -->
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment