website/public/API/getMail.php

22 lines
No EOL
461 B
PHP

<?php
include("./lib/config.php");
require("./vendor/autoload.php");
use GuzzleHttp\Client;
$data = array(
'secret' => $secretkey,
'response' => $_POST['h-captcha-response']
);
$client = new Client();
$response = $client->post("https://hcaptcha.com/siteverify", [
"form_params" => $data
]);
$responseData = json_decode($response->getBody());
if($responseData->success) {
echo("$contactmail");
} else {
echo("Failed to verify Captcha");
}