:::

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');

 


:::

書籍目錄

展開 | 闔起

http%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D30%26tbdsn%3D803

計數器

今天: 1273127312731273
昨天: 2138213821382138
總計: 7322555732255573225557322555732255573225557322555