(一)免登入,未使用資料庫(預設連資料庫,不管工作程式須不須要)
<?php
include_once 'userConstant.php' 或 'constant.php'; // 載入伺服器參數
include_once 'theme.php'; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
$str=…;
echo $html1;
echo $str;
echo $html2;
?>
(二)使用 ajax 更新畫面,不靠翻頁
<?php
include_once 'userConstant.php' 或 'constant.php';
include_once 'theme.php';
include CLASS_FILE_PATH.'/database/login.php'; // 只用 login::js() ,不使用 login()
if(!isset($_REQUEST['某個透過ajax傳送的變數'])){echo $html1.login::js();}
…
if(!isset($_REQUEST['某個透過ajax傳送的變數'])){echo $html2;}
?>
(三)免登入,使用資料庫(預設連資料庫,不管工作程式須不須要)
<?php
include_once 'userConstant.php' 或 'constant.php';
include_once 'theme.php'; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
$result=DB::queryF("…");
$str=…;
while($row=mysqli_fetch_assoc($result)){$str.=…;}
echo $html1;
echo $str;
echo $html2;
?>