Example #1
0
<hr />
</div>' . "\n";
    foot($dat);
    echo $dat;
}
/*-----------程式各項功能主要判斷-------------*/
if (GZIP_COMPRESS_LEVEL && ($Encoding = CheckSupportGZip())) {
    ob_start();
    ob_implicit_flush(0);
}
// 支援且開啟Gzip壓縮就設緩衝區
$mode = isset($_GET['mode']) ? $_GET['mode'] : (isset($_POST['mode']) ? $_POST['mode'] : '');
// 目前執行模式 (GET, POST)
switch ($mode) {
    case 'regist':
        regist();
        break;
    case 'admin':
        $admin = isset($_REQUEST['admin']) ? $_REQUEST['admin'] : '';
        // 管理者執行模式
        valid();
        switch ($admin) {
            case 'del':
                admindel();
                break;
            case 'logout':
                adminAuthenticate('logout');
                header('HTTP/1.1 302 Moved Temporarily');
                header('Location: ' . fullURL() . PHP_SELF2 . '?' . time());
                break;
            case 'optimize':
Example #2
0
/* スキン取得                              */
/*=========================================*/
$tmp_skin = @file($datadir . "skin.txt");
$skin_file = $skindir . trim($tmp_skin[0]) . "/skin.html";
/*=========================================*/
/* PHP_SELF or SCRIPT_NAME                 */
/*=========================================*/
$sn = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER["SCRIPT_NAME"];
/*=========================================*/
/* データ更新                              */
/*=========================================*/
if ($_POST["mode"]) {
    //ファイル名
    $filename = $datadir . $_POST["mode"] . '.txt';
    //更新
    if (@regist($_POST[$_POST["mode"]], $filename)) {
        header("Location: " . basename($sn) . "?set=1&set_no=" . $_GET["set_no"]);
        exit;
    } else {
        header("Location: " . basename($sn) . "?set=2&set_no=" . $_GET["set_no"]);
        exit;
    }
}
/*=========================================*/
/* プラグイン読み込み                      */
/*=========================================*/
$settting["plugin"] = array();
$settting["plugin"] = getfilelist($plugindir);
if (is_array($settting["plugin"])) {
    foreach ($settting["plugin"] as $k => $v) {
        if (!eregi("(\\.php)\$", $v)) {
Example #3
0
    if ($err) {
        error($err);
    }
}
/*-----------Main-------------*/
init();
//←■■初期設定後は不要なので削除可■■
$iniv = array('mode', 'name', 'email', 'sub', 'com', 'pwd', 'upfile', 'upfile_name', 'resto', 'pass', 'res', 'post', 'no');
foreach ($iniv as $iniva) {
    if (!isset(${$iniva})) {
        ${$iniva} = "";
    }
}
switch ($mode) {
    case 'regist':
        regist($name, $email, $sub, $com, '', $pwd, $upfile, $upfile_name, $resto);
        break;
    case 'admin':
        valid($pass);
        if ($admin == "del") {
            admindel($pass);
        }
        if ($admin == "post") {
            echo "</form>";
            form($post, $res, 1);
            echo $post;
            die("</body></html>");
        }
        break;
    case 'usrdel':
        usrdel($no, $pwd);
Example #4
0
            $regist_flg = true;
            break;
        case "del":
            foreach ($ch_id as $k => $v) {
                if ($_POST["id"] == $k && $_POST["name"] == $v) {
                    unset($ch_id[$_POST["id"]]);
                    continue;
                }
                $ch_id_data .= $k . "||" . $v . "\n";
            }
            $regist_flg = true;
            break;
    }
    //更新
    if ($regist_flg) {
        regist($ch_id_data, $file_name);
    }
}
/*=========================================*/
/* データ編集                              */
/*=========================================*/
if (is_array($data)) {
    foreach ($data as $k => $v) {
        if ($v["ch_id"]) {
            continue;
        }
        $main[$v["id"]] = true;
    }
    unset($data);
}
//ソート
Example #5
0
/* Auto-Linkify HTTP links */
function auto_link($proto)
{
    $proto = ereg_replace("(https?|ftp|news)(://[[:alnum:]\\+\$\\;\\?\\.%,!#~*/:@&=_-]+)", "<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</a>", $proto);
    return $proto;
}
/* Display errors */
function error($mes)
{
    global $path;
    echo head();
    echo "<br><br><hr size=1><br><br>\n        <center><font color=red size=5><b>{$mes}</b></font></center>\n        <br><br><hr size=1>";
    die("</body></html>");
}
/*-----------Main-------------*/
switch ($mode) {
    case 'regist':
        regist($name, $email, $sub, $com, $url, $pwd);
        break;
    case 'add':
        valid($pass);
        echo form($post, 1);
        admindel($del, $chk, $pass);
        echo $post;
        die("</body></html>");
        break;
    case 'usrdel':
        usrdel($no, $pwd);
    default:
        main();
}
Example #6
0
<meta http-equiv="refresh" content="3;url= http://localhost/546Final/pages/index.php ">
<?php 
include "./DB.php";
if (isset($_POST["email"]) && isset($_POST["Name"]) && isset($_POST["password"])) {
    $Email = $_POST["email"];
    $Name = $_POST["Name"];
    $Password = $_POST["password"];
    $res = regist($Email, $Name, $Password);
    if ($res == -1) {
        echo "Register fail!<br/>\n";
    } else {
        echo "Register Success! Your ID is {$res}<br/>\n";
    }
} else {
    echo "Register fail!<br/>\n";
}