-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.php
32 lines (28 loc) · 829 Bytes
/
action.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
31
32
<?php
if (isset($_POST['post'])) {
// print_r($_POST);
$url = "https://www.google.com/recaptcha/api/siteverify";
$data = [
'secret' => "your server side key here",
'response' => $_POST['token'],
// 'remoteip' => $_SERVER['REMOTE_ADDR']
];
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);
$res = json_decode($response, true);
if ($res['success'] == true) {
echo "Verification Success";
} else {
echo "Verification Failed";
}
echo "<br><br>";
var_dump($res);
}
?>