4-5
header.php
<?php
session_start();
require_once "config.php";
require_once 'function.php';
require_once 'smarty/libs/Smarty.class.php';
//實體化
$smarty = new Smarty;
//連線資料庫
$db = link_db();
// throw new Exception(var_dump($smarty));
//變數過濾或預設直
$name = isset($_SESSION['name']) ? htmlspecialchars($_SESSION['name'], ENT_QUOTES) : '訪客';
$group = isset($_SESSION['group']) ? $_SESSION['group'] : '';
$op = isset($_REQUEST['op']) ? htmlspecialchars($_REQUEST['op'], ENT_QUOTES) : '';
$error = $content = '';