Esempio n. 1
0
<?php

include_once '../lib/glob.php';
include_once '../lib/lib.php';
if (isset($_POST["search_word"]) and !empty($_POST["search_word"])) {
    $_GET["search_word"] = lib_simp_to_trad(lib_cn_name_filter($_POST["search_word"]));
}
//set GET vars:
//diplay
if (isset($_GET["form"])) {
    if ($_GET["form"] == "grid") {
        $url_display = "grid";
    } else {
        $url_display = "list";
    }
} else {
    $url_display = "list";
}
//keyword
if (isset($_GET["search_word"])) {
    if ($_GET["search_word"] == "any") {
        $url_keyword = "";
    } else {
        $url_keyword = $_GET["search_word"];
    }
} else {
    $url_keyword = "";
}
//orderBy
if (isset($_GET["orderby"])) {
    if ($_GET["orderby"] == "hit_count") {
Esempio n. 2
0
<?php

include_once '../lib/glob.php';
include_once '../lib/lib.php';
//security check:
if (!isset($_POST["Username"]) or !isset($_POST["Password"])) {
    die("<h1>ERROR ON PAGE</h1>");
}
//assign vars
$usr = lib_cn_name_filter(trim($_POST["Username"]));
$psw = lib_psw_filter(trim($_POST["Password"]));
//check if password and username match:
if (isUsrPswMatch($usr, $psw)) {
    if (email_vertify($usr)) {
        $_SESSION["username"] = $usr;
        $_SESSION["password"] = $psw;
        $_SESSION["id"] = getUserID($usr, $psw);
        header("Location:../index.php");
        exit;
    } else {
        setAlertMsg("帳號還沒有被激活!");
        header("Location:../login.php");
        exit;
    }
} else {
    setAlertMsg("用戶或密碼不正確!");
    header("Location:../login.php");
    exit;
}