Advertisement
ExeQue

Untitled

Jun 4th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])):
  3.     //your site secret key
  4.     $secret = '9LuDh9kyetYYYYdT0jsVckScsH8Ks3KA';
  5.     //get verify response data
  6.     $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
  7.     $responseData = json_decode($verifyResponse);
  8.     if($responseData->success):
  9.         //Code if reCaptcha is verified
  10.     endif;
  11. endif;
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement