<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $config = [
        'slider_speed' => (int)$_POST['slider_speed'],
        'breaking_news' => $_POST['breaking_news']
    ];
    file_put_contents('config.json', json_encode($config, JSON_PRETTY_PRINT));
    header('Location: index.php');
    exit;
}
?>
