:::

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%3Ftbdsn%3D803%26tbsn%3D30

計數器

今天: 856856856
昨天: 3068306830683068
總計: 8077361807736180773618077361807736180773618077361