<?php


error_reporting(E_ALL);
ini_set('display_errors', 1);



<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

$data = json_decode(file_get_contents("php://input"), true);
if ($data) {
    file_put_contents("debug_log.txt", print_r($data, true) . "\n", FILE_APPEND);
    echo "Log saved.";
} else {
    echo "No data received.";
}
?>



/*
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $data = json_decode(file_get_contents("php://input"), true);
    $log = "Raw Scanned QR Code: " . $data["raw_text"] . "\n";
    $log .= "Extracted Secret: " . $data["extracted_secret"] . "\n";
    $log .= "-------------------------------\n";

    file_put_contents("debug_log.txt", $log, FILE_APPEND);
}*/
?>
