Skip to content

Instantly share code, notes, and snippets.

@Maxim-Kolmogorov
Created June 4, 2020 11:52
Show Gist options
  • Save Maxim-Kolmogorov/c697161cd5e7e1e6e72b94ef1457fc54 to your computer and use it in GitHub Desktop.
Save Maxim-Kolmogorov/c697161cd5e7e1e6e72b94ef1457fc54 to your computer and use it in GitHub Desktop.
<?php
$secret = 'ВАШ_СЕКРЕТНЫЙ_КЛЮЧ';
$params = array(
'secret' => $secret,
'response' => $_SESSION['recaptcha_token'],
);
$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($params)
));
$response = curl_exec($myCurl);
curl_close($myCurl);
$response = json_decode($response, true);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment