因為每個程式都用,所以放head.php
<?php
session_start();//啟用 $_SESSION,前面不可以有輸出
error_reporting(E_ALL); @ini_set('display_errors', true);//設定所有錯誤都顯示
// URL Association for SSL and Protocol Compatibility
$http = 'http://';
if (!empty($_SERVER['HTTPS'])) {
$http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
}
#網站實體路徑
define('WEB_PATH', str_replace("\\","/",dirname(__FILE__)));
#網站URL
define('WEB_URL', $http.$_SERVER["HTTP_HOST"].str_replace($_SERVER["DOCUMENT_ROOT"],"",WEB_PATH));
#佈景目錄
$WEB['theme_name'] = "default";
#網站名稱
$WEB['title'] = "網站名稱";
#程式檔名(含副檔名)
$WEB['file_name'] = basename ($_SERVER['PHP_SELF']);//index.php
#引入 mysql設定
require_once 'config.php';
#引入樣版引擎s
require_once 'smarty.php';
#共用函數
require_once 'function.php';
#導航
require_once 'nav.php';