From 6c12179b49b32b38d2004513f909b86ef0327a71 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 25 Jul 2018 17:24:08 -0600 Subject: [PATCH] Improve output of test.php --- test.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test.php b/test.php index 663015b..592864d 100644 --- a/test.php +++ b/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,8 +18,16 @@ $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']); + exit("\n\nCAPTCHA did not verify: " . $resp['msg']); } else { exit("\n\nCAPTCHA verified!"); }