Created
June 4, 2020 11:52
-
-
Save Maxim-Kolmogorov/c697161cd5e7e1e6e72b94ef1457fc54 to your computer and use it in GitHub Desktop.
Send the secret key for an article: https://kolmogorov.pro/integration_google_recaptcha_v3_in_site_on_vue_js
This file contains hidden or 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 | |
$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