parent
f0101aaea2
commit
70c45d24f7
@ -1,6 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
//header("Content-Type: application/json");
|
|
||||||
header("Content-Type: text/plain");
|
header("Content-Type: text/plain");
|
||||||
|
|
||||||
echo json_encode(["get" => $_GET, "api" => json_decode(file_get_contents("http://localhost/captcheck/api.php?action=verify&session_id=" . $_GET["captcheck_session_code"] . "&answer_id=".$_GET["captcheck_selected_answer"]), true)]);
|
var_dump($_POST);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$url = 'https://captcheck.netsyms.com/api.php';
|
||||||
|
$data = [
|
||||||
|
'session_id' => $_POST['captcheck_session_code'],
|
||||||
|
'answer_id' => $_POST['captcheck_selected_answer'],
|
||||||
|
'action' => "verify"
|
||||||
|
];
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||||
|
'method' => 'POST',
|
||||||
|
'content' => http_build_query($data)
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$context = stream_context_create($options);
|
||||||
|
$result = file_get_contents($url, false, $context);
|
||||||
|
$resp = json_decode($result, TRUE);
|
||||||
|
if (!$resp['result']) {
|
||||||
|
exit("\n\nCAPTCHA did not verify:" . $resp['msg']);
|
||||||
|
} else {
|
||||||
|
exit("\n\nCAPTCHA verified!");
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue