MrCloud
December 9, 2022, 8:13am
#1
I can’t seem to get turnstile working. I followed the guide for swapping out recaptcha and it appears. But I just can’t verify them. Cloudflare returns 404? Am I missing something?
$responseurl = “https://challenges.cloudflare.com/turnstile/v0/siteverify?secret=“.$secretKey.”&response=“.$captcha.”&remoteip= ”.$ip;
$response = file_get_contents($responseurl);
I’ve verified it gets filled out correctly afaik
MrCloud
December 9, 2022, 8:28am
#2
So it looks like it wants a post. So dumb. I wasted hours debugging. Why require a post?
This is what i did…Not sure if it is the best way, but it worked for me.
$captcha=$_POST['cf-turnstile-response'];
if (!$captcha) {
// What happens when the CAPTCHA was entered incorrectly
echo '<h2>Please check the the captcha form.</h2>';
exit;
}
$secretKey = "xxxxxxxxxxxxxxxxxxxxx";
$ip = $_SERVER['REMOTE_ADDR'];
$url_path = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
$data = array('secret' => $secretKey, 'response' => $captcha, 're…
KianNH
December 9, 2022, 8:42am
#3
Because that’s how HTTP works - you’re sending a body of data.
https://www.rfc-editor.org/rfc/rfc7231#section-4.3.3
It’s also documented here:
2 Likes
MrCloud
December 9, 2022, 8:54am
#4
Still dumb. Get parameters exist. Google accepted it fine. I gave up, it’s not as drop in as I thought swapping many out.
https://www.rfc-editor.org/rfc/rfc3986
system
Closed
December 12, 2022, 8:55am
#5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.