:::

2-1 index.php

<?php
/*引入檔案(初始設定)*/
require_once 'config.php';
require_once 'smarty/libs/Smarty.class.php';
$smarty = new Smarty;
// $smarty->clearAllCache();

/*過濾變數*/
$name    = isset($_POST['email']) ? filter_var($_POST['email'], FILTER_SANITIZE_SPECIAL_CHARS) : "訪客";
$pass    = isset($_POST['pass']) ? $_POST['pass'] : "";
$op      = isset($_REQUEST['op']) ? filter_var($_REQUEST['op'], FILTER_SANITIZE_SPECIAL_CHARS) : "";
$content = "主內容";

/*執行流程*/
switch ($op) {
    case 'login':
        $content = ($name == $admin_id and $pass == $admin_pass) ? "登入成功" : "登入失敗";
        break;

    default:
        # 取得活動列表
        break;
}

/*輸出結果*/
$smarty->assign('name', $name);
$smarty->assign('content', $content);
$smarty->assign('page_title', '活動報名系統');
$smarty->display('index.tpl');

 


:::

書籍目錄

展開 | 闔起

https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D803

計數器

今天: 3017301730173017
昨天: 3438343834383438
總計: 7393346739334673933467393346739334673933467393346