<?php
include("./config.php");
$data = array(
    'secret' => $secretkey,
    'response' => $_POST['h-captcha-response']
);

$verify = curl_init();
curl_setopt($verify, CURLOPT_URL, "https://hcaptcha.com/siteverify");
curl_setopt($verify, CURLOPT_POST, true);
curl_setopt($verify, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($verify, CURLOPT_RETURNTRANSFER, true);
$response_ = curl_exec($verify);
$responseData = json_decode($response_);



if($responseData->success) {
    echo("$contactmail");
} else {
    echo("Failed to verify Captcha");
}