require 'includes/flash.php';

set_flash("Settings saved successfully!");
header("Location: dashboard.php");
exit;
top of content
require 'includes/flash.php';
display_flash();
toggel sidebar
<div class="topbar">
    <div class="menu-toggle" onclick="toggleSidebar()">☰</div>
    <div class="title">My Panel</div>
</div>

<div class="layout">
    <div id="sidebar" class="sidebar">
        <!-- your menu -->
    </div>

    <div id="content" class="content">
        <!-- your main content -->
    </div>
</div>
//java for sidebar hide
<script>
function toggleSidebar() {
    let sidebar = document.getElementById('sidebar');
    sidebar.classList.toggle('hidden');

    // optional: save state
    localStorage.setItem('sidebarHidden', sidebar.classList.contains('hidden'));
}

// restore state on load
window.onload = function() {
    if (localStorage.getItem('sidebarHidden') === 'true') {
        document.getElementById('sidebar').classList.add('hidden');
    }
};
</script>
//colaspe instead of hide
.sidebar.collapsed {
    width: 60px;
}
//content wrapper must be on every page
<div class="layout">
    <div id="sidebar" class="sidebar">
        <!-- menu -->
    </div>

    <div id="content" class="content">