Improve output of test.php
This commit is contained in:
parent
f5ca72b318
commit
6c12179b49
12
test.php
12
test.php
|
@ -2,10 +2,6 @@
|
|||
|
||||
header("Content-Type: text/plain");
|
||||
|
||||
var_dump($_POST);
|
||||
|
||||
|
||||
|
||||
$url = 'https://captcheck.netsyms.com/api.php';
|
||||
$data = [
|
||||
'session_id' => $_POST['captcheck_session_code'],
|
||||
|
@ -22,6 +18,14 @@ $options = [
|
|||
$context = stream_context_create($options);
|
||||
$result = file_get_contents($url, false, $context);
|
||||
$resp = json_decode($result, TRUE);
|
||||
|
||||
echo "Form fields:\n";
|
||||
var_export($_POST);
|
||||
echo "\n\nAPI request fields:\n";
|
||||
var_export($data);
|
||||
echo "\n\nAPI response (JSON):\n";
|
||||
echo json_encode(json_decode($result, TRUE), JSON_PRETTY_PRINT);
|
||||
|
||||
if (!$resp['result']) {
|
||||
exit("\n\nCAPTCHA did not verify: " . $resp['msg']);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue