後台管理系統使用 `
<!-- frameset 主頁 --> <frameset rows="*" cols="185px,*" frameborder="no" border="0" framespacing="0" id="AdminMain"> <frame src="user_left.php" frameborder="0" name="leftFrame" scrolling="yes" noresize="noresize" id="leftFrame" title="leftFrame" /> <frame src="user_right.php" name="mainFrame" id="mainFrame" title="mainFrame" /> </frameset> <!-- 左側菜單退出鏈接 --> <a class="menuChild" href="index.php?action=logoff" target="_self">退出系統</a>
target="_self"
<a class="menuChild" href="index.php?action=logoff" target="_top">退出系統</a>
<!-- user_left.php 菜單欄 --> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>管理後台菜單</title> </head> <body> <ul class="menu"> <li><a href="dashboard.php" target="mainFrame">儀表盤</a></li> <li><a href="users.php" target="mainFrame">用戶管理</a></li> <li><a href="settings.php" target="mainFrame">系統設置</a></li> <li class="logout"> <a href="index.php?action=logoff" target="_top"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path> <polyline points="16 17 21 12 16 7"></polyline> <line x1="21" y1="12" x2="9" y2="12"></line> </svg> 退出系統 </a> </li> </ul> </body> </html>
<frameset>、<frame> 已在 **HTML5 標準中廢棄**,存在:
<frameset>
<frame>
<!-- 現代後台布局 (Flexbox/Grid) --> <div class="app-layout"> <aside class="sidebar" id="sidebar"> <nav> <a href="/dashboard" data-nav>儀表盤</a> <a href="/users" data-nav>用戶管理</a> <a href="/settings" data-nav>設置</a> <button id="btnLogout">退出系統</button> </nav> </aside> <main class="content" id="mainContent"></main> </div> <script> // 退出登入:全頁跳轉 document.getElementById('btnLogout').addEventListener('click', () => { window.location.href = '/logout'; // 或 fetch('/logout').then(() => location.reload()) }); // 菜單導航:AJAX 獲取內容注入 mainContent document.querySelectorAll('[data-nav]').forEach(a => { a.addEventListener('click', e => { e.preventDefault(); fetch(a.href).then(r => r.text()).then(html => { document.getElementById('mainContent').innerHTML = html; history.pushState(null, '', a.href); // 更新 URL }); }); }); </script>
PHP 輸入輸出流 (php://) 完整指南 PHP 通過
專案背景 貼吧推廣常見「留郵箱領資源」帖子,熱門帖回覆動輒上
項目背景 作為實習生的第一個獨立項目,需求是構建一個輕量級企
環境與版本 OS: Red Hat Enterprise