Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])):
- //your site secret key
- $secret = '9LuDh9kyetYYYYdT0jsVckScsH8Ks3KA';
- //get verify response data
- $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
- $responseData = json_decode($verifyResponse);
- if($responseData->success):
- //Code if reCaptcha is verified
- endif;
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement