「LiteSite/工作程式」修訂間的差異
跳至導覽
跳至搜尋
| 第1行: | 第1行: | ||
| − | == | + | ===一、免登入,未使用資料庫(預設連資料庫,不管工作程式須不須要)=== |
<pre><?php | <pre><?php | ||
include_once '../../constant.php'; // 載入伺服器參數 | include_once '../../constant.php'; // 載入伺服器參數 | ||
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫 | ||
$str=…; | $str=…; | ||
| + | if(!isset($_REQUEST['ajax'])){echo $html1;} | ||
| + | echo $str; | ||
| + | if(!isset($_REQUEST['ajax'])){echo $html2;} | ||
| + | ?></pre> | ||
| + | |||
| + | ===二、免登入,使用資料庫(預設連資料庫,不管工作程式須不須要)=== | ||
| + | <pre><?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['ajax'])){echo $html1;} | if(!isset($_REQUEST['ajax'])){echo $html1;} | ||
echo $str; | echo $str; | ||
if(!isset($_REQUEST['ajax'])){echo $html2;} | if(!isset($_REQUEST['ajax'])){echo $html2;} | ||
?></pre> | ?></pre> | ||
於 2021年6月14日 (一) 18:26 的修訂
一、免登入,未使用資料庫(預設連資料庫,不管工作程式須不須要)
<?php
include_once '../../constant.php'; // 載入伺服器參數
include_once "../theme.php"; // 載入 site 布景,順便會載入 site 常、變數,連資料庫
$str=…;
if(!isset($_REQUEST['ajax'])){echo $html1;}
echo $str;
if(!isset($_REQUEST['ajax'])){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['ajax'])){echo $html1;}
echo $str;
if(!isset($_REQUEST['ajax'])){echo $html2;}
?>