<?php
session_start();
error_reporting(0);

// Path to the JSON file
$infoFilePath = "../control-panel/user-action/data.json";

// Read the contents of the JSON file
$json_data = file_get_contents($infoFilePath);

// Decode the JSON data into a PHP associative array
$infoContent = json_decode($json_data, true);

// Check if the 'redirect_user' key exists and is not empty
if (isset($infoContent['redirect_user']) && !empty($infoContent['redirect_user'])) {
    // Return the 'redirect_user' value
    echo json_encode(['redirect_user' => $infoContent['redirect_user']]);
} else {
    echo json_encode(['redirect_user' => '']);
}

?>
