dj_mix_hosting_software/settings.php
Cody Cook 8b4dfe0c0c
All checks were successful
SonarQube Scan / SonarQube Trigger (push) Successful in 37s
Dark mode and other color enhancements to match
2024-05-13 19:38:06 -07:00

13 lines
446 B
PHP

<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'darkmode') {
$darkmode = $_POST['value'] === 'true' ? 'true' : 'false';
$_SESSION['darkmode'] = $darkmode; // Update the session to reflect the new mode
// Send a JSON response back to JavaScript
header('Content-Type: application/json');
echo json_encode(['darkmode' => $darkmode]);
exit;
}