2020-12-30 23:33:07 +01:00
|
|
|
<?php
|
2021-04-12 20:43:43 +02:00
|
|
|
include("./lib/config.php");
|
2021-07-21 17:28:29 +02:00
|
|
|
|
|
|
|
require("./vendor/autoload.php");
|
|
|
|
use GuzzleHttp\Client;
|
|
|
|
|
2020-12-30 23:33:07 +01:00
|
|
|
$data = array(
|
|
|
|
'secret' => $secretkey,
|
|
|
|
'response' => $_POST['h-captcha-response']
|
|
|
|
);
|
2021-07-21 17:28:29 +02:00
|
|
|
$client = new Client();
|
2020-12-30 23:33:07 +01:00
|
|
|
|
2021-07-21 17:28:29 +02:00
|
|
|
$response = $client->post("https://hcaptcha.com/siteverify", [
|
|
|
|
"form_params" => $data
|
|
|
|
]);
|
2020-12-30 23:33:07 +01:00
|
|
|
|
2021-07-21 17:28:29 +02:00
|
|
|
$responseData = json_decode($response->getBody());
|
2020-12-30 23:33:07 +01:00
|
|
|
if($responseData->success) {
|
|
|
|
echo("$contactmail");
|
|
|
|
} else {
|
|
|
|
echo("Failed to verify Captcha");
|
|
|
|
}
|