Last active
March 29, 2020 11:16
-
-
Save DaltonWebDev/83a33924258c87de6bf5cad168f622b3 to your computer and use it in GitHub Desktop.
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 | |
$captchaVerification = !empty($_REQUEST["captcha_verification"]) ? $_REQUEST["captcha_verification"] : false; | |
if ($captchaVerification !== false) { | |
$data = [ | |
"endpoint" => "verify", | |
"captcha_verification" => $captchaVerification, | |
"captcha_difficulty" => 5 // make sure the difficulty matches the diffulty you added to form button | |
]; | |
$options = [ | |
"http" => [ | |
"method" => "POST", | |
"user_agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36", | |
"header" => "Content-Type: application/x-www-form-urlencoded", | |
"content" => http_build_query($data) | |
] | |
]; | |
$context = stream_context_create($options); | |
$verify = file_get_contents("https://wehatecaptchas.com/api.php", false, $context); | |
$response = json_decode($verify, true); | |
$verify = $response["data"]["verified"]; | |
} else { | |
$verify = false; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment