Created
May 14, 2015 13:32
-
-
Save Nelrohd/4f0a31f03a313be9e8a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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