「LiteSite/工作程式」修訂間的差異
跳至導覽
跳至搜尋
| 第1行: | 第1行: | ||
[[分類:LiteSite]] | [[分類:LiteSite]] | ||
| − | !isset($_REQUEST['exec_type']) | + | #!isset($_REQUEST['exec_type']) 條件是給一般工作程式用的,只要 exec_type 沒了,就重刷新的 theme |
| + | #!isset($_REQUEST['ajax']) 條件是給 /webContent.php 專用的,任何 theme 都不變化 | ||
===一、免登入,未使用資料庫(預設連資料庫,不管工作程式須不須要)=== | ===一、免登入,未使用資料庫(預設連資料庫,不管工作程式須不須要)=== | ||
<pre><?php | <pre><?php | ||
| 第6行: | 第7行: | ||
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | ||
$str=…; | $str=…; | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html1;} |
echo $str; | echo $str; | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html2;} |
?></pre> | ?></pre> | ||
| 第18行: | 第19行: | ||
$str=…; | $str=…; | ||
while($row=mysqli_fetch_assoc($result)){$str.=…;} | while($row=mysqli_fetch_assoc($result)){$str.=…;} | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html1;} |
echo $str; | echo $str; | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html2;} |
?></pre> | ?></pre> | ||
| 第27行: | 第28行: | ||
include_once '../../constant.php'; // 載入伺服器參數 | include_once '../../constant.php'; // 載入伺服器參數 | ||
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html1;} // 本行須在 theme.php 與 $login->logon(); 之間 |
$nowMsg="僅允許…看…。"; | $nowMsg="僅允許…看…。"; | ||
include_once CLASS_FILE_PATH."/database/login.php"; | include_once CLASS_FILE_PATH."/database/login.php"; | ||
| 第37行: | 第38行: | ||
} | } | ||
echo $str; | echo $str; | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html2;} |
?></pre> | ?></pre> | ||
| 第44行: | 第45行: | ||
include_once '../../constant.php'; // 載入伺服器參數 | include_once '../../constant.php'; // 載入伺服器參數 | ||
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html1;} // 本行須在 theme.php 與 $ET->main(); 之間 |
$nowMsg="僅允許…看…。"; | $nowMsg="僅允許…看…。"; | ||
include_once CLASS_FILE_PATH."/database/etable.php"; | include_once CLASS_FILE_PATH."/database/etable.php"; | ||
| 第51行: | 第52行: | ||
$ET->sql[0]="…"; | $ET->sql[0]="…"; | ||
$ET->main(); | $ET->main(); | ||
| − | if(!isset($_REQUEST[' | + | if(!isset($_REQUEST['exec_type'])){echo $html2;} |
?></pre> | ?></pre> | ||
於 2021年6月14日 (一) 22:08 的修訂
- !isset($_REQUEST['exec_type']) 條件是給一般工作程式用的,只要 exec_type 沒了,就重刷新的 theme
- !isset($_REQUEST['ajax']) 條件是給 /webContent.php 專用的,任何 theme 都不變化
一、免登入,未使用資料庫(預設連資料庫,不管工作程式須不須要)
<?php
include_once '../../constant.php'; // 載入伺服器參數
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
$str=…;
if(!isset($_REQUEST['exec_type'])){echo $html1;}
echo $str;
if(!isset($_REQUEST['exec_type'])){echo $html2;}
?>
二、免登入,使用資料庫(預設連資料庫,不管工作程式須不須要)
<?php
include_once '../../constant.php'; // 載入伺服器參數
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
$result=DB::queryF("…");
$str=…;
while($row=mysqli_fetch_assoc($result)){$str.=…;}
if(!isset($_REQUEST['exec_type'])){echo $html1;}
echo $str;
if(!isset($_REQUEST['exec_type'])){echo $html2;}
?>
三、登入
<?php
include_once '../../constant.php'; // 載入伺服器參數
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
if(!isset($_REQUEST['exec_type'])){echo $html1;} // 本行須在 theme.php 與 $login->logon(); 之間
$nowMsg="僅允許…看…。";
include_once CLASS_FILE_PATH."/database/login.php";
$login = new login;
$login->loginTable=…;
$login->logon();
if(isset($login->checkin) && $login->checkin==1){
$str=…;
}
echo $str;
if(!isset($_REQUEST['exec_type'])){echo $html2;}
?>
四、使用 etable ,是否登入不影響結構
<?php
include_once '../../constant.php'; // 載入伺服器參數
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
if(!isset($_REQUEST['exec_type'])){echo $html1;} // 本行須在 theme.php 與 $ET->main(); 之間
$nowMsg="僅允許…看…。";
include_once CLASS_FILE_PATH."/database/etable.php";
$ET = new etable;
$ET->loginTable=…; // 本行在須登入時才出現
$ET->sql[0]="…";
$ET->main();
if(!isset($_REQUEST['exec_type'])){echo $html2;}
?>