22 lines
No EOL
528 B
PHP
22 lines
No EOL
528 B
PHP
<?php
|
|
use GuzzleHttp\Client;
|
|
|
|
function mailAddress($hCaptchaResponse) {
|
|
require "./lib/config.php";
|
|
$data = array(
|
|
'secret' => $secretkey,
|
|
'response' => $hCaptchaResponse
|
|
);
|
|
$client = new Client();
|
|
|
|
$response = $client->post("https://hcaptcha.com/siteverify", [
|
|
"form_params" => $data
|
|
]);
|
|
|
|
$responseData = json_decode($response->getBody());
|
|
if($responseData->success) {
|
|
return "$contactmail";
|
|
} else {
|
|
return "Failed to verify Captcha";
|
|
}
|
|
} |