-
Notifications
You must be signed in to change notification settings - Fork 0
/
posttest.php
30 lines (27 loc) · 1.09 KB
/
posttest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<body>
Welcome <?php echo $_POST["username"]; ?> </br>
Your blood group is: <?php echo $_POST["bloodgroup"]; ?> </br></br>
cf-turnstile-response (Token) is: <?php echo $_POST["cf-turnstile-response"]; ?> </br></br>
siteverify result is: <?php
$data = [];
$data['secret'] = 'YOUR_SECRET_KEY';
$data['response'] = $_POST["cf-turnstile-response"];
// 送信データをURLエンコード
$data = http_build_query($data, "", "&");
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://challenges.cloudflare.com/turnstile/v0/siteverify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}?>
</body>
</html>