Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. public function captcha_check($captcha){
  2.  
  3.         $secretKey = "6Ld9dTsUAAAAAFSlUdXlSmvgaDAjULXgqonUDGOe";
  4.         $ip = getip();
  5.         $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
  6.         $responseKeys = json_decode($response,true);
  7.         if(intval($responseKeys["success"]) !== 1) {
  8.             return FALSE;
  9.         }else{
  10.             return TRUE;
  11.         }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement