예제 #1
0
     $nextAccess = 0;
 } elseif (!ereg("^[a-zA-Z0-9_]+\$", $admin)) {
     $str = "<SPAN class=err>{$strUserAlert}</span>";
     $nextAccess = 0;
 } elseif (strlen($admin_pw) < 6) {
     $str = "<SPAN class=err>{$strUserAlert}</span>";
     $nextAccess = 0;
 } elseif ($admin_pw != $admin_pw2) {
     $str = "<SPAN class=err>{$strErrPw}</span>";
     $nextAccess = 0;
 } else {
     //插入管理员
     include '../include/config.php';
     include '../include/db.php';
     // 连结数据库
     $DMC = new DummyMySQLClass($DBHost, $DBUser, $DBPass, $DBName, false);
     $DMC->query("TRUNCATE TABLE `" . $DBPrefix . "members`");
     $DMC->query("INSERT INTO `" . $DBPrefix . "members` (username,password,role) VALUES ('{$admin}',md5('{$admin_pw}'),'admin')");
     $DMC->query("INSERT INTO `" . $DBPrefix . "setting` VALUES (1, 'F2Blog', 'Free & Freedom Blog', '{$admin_url}', '', '', '', '{$admin}', '{$admin_email}', 0, 0, 50, 0, 0, 0, 0, 0, 8, 20, 0, 0, 0, 1, 10, 0, 0, 0, 0, 0, 0, 1, 30, 800, 'default', 0, 1, 1, 0, '', '{$language}', '8', 'Y-m-d H:i', '', '', '', '', '', '', '', 0, 0, '', 10, 0)");
     //生成Cache文件
     include "../include/cache.php";
     reAllCache();
     $str .= "<table border='0' cellpadding='0' cellspacing='0' width='100%'>\n";
     $str .= "  <tr>\n";
     $str .= "    <td width='100%' valign='top'><br>\n";
     $str .= "     <span class='install'><b>F2Blog{$strInstallComp}.</b><br>\n";
     $str .= "      <br>\n";
     $str .= "      {$strDelInstall}\n";
     $str .= "      <br><br>\n";
     $str .= "      {$strLoginIndex}</td>\n";
     $str .= "  </tr>\n";
예제 #2
0
<?php

require_once "db.php";
//数据库类型名称://入口帐号:入口密码@数据库主机名:端口号/数据库名/是否总是打开新的连接
$dsn = "MySQL://*****:*****@localhost:3306/tetx/false";
$DMC = new DummyMySQLClass($dsn);
//$DMC    = new DummyMySQLClass("localhost","root","","test");
//print_r($DMC);
$DMC->query("use mysql");
$queryResult = $DMC->query("SHOW TABLE STATUS FROM user");
if (false === $queryResult) {
    $DMC->halt('查询失败:' . $sql_Get_SelectedDB_Tables);
} else {
    // 处理~
    while ($fo = $DMC->fetchObject()) {
        $tableName = $fo->Name;
        $DataRecord = $fo->Rows;
        $DataSize = $fo->Data_length + $fo->Index_length;
        $Surplus = $fo->Data_free;
        $TableType = $fo->Type;
        $TableEncode = $fo->Collation;
        $TotalRecord += $DataRecord;
        $DBEncode = $TableEncode;
        $TotalSize += $DataSize;
        $TotalSurplus = $Surplus;
    }
    // ……
}
// drop table if exists
$md5 = md5('admin');
$sql_Drop = "DROP TABLE IF EXISTS dmc_demo;";
예제 #3
0
include_once $plugins_path . "include/cache.php";
include_once $plugins_path . "include/common.php";
include_once $plugins_path . "include/config.php";
include_once $plugins_path . "include/db.php";
include_once $plugins_path . "include/global.inc.php";
//如果设定config.php文件,则安装。
if ($DBUser == "" || $DBPass == "" || $DBName == "") {
    if (!file_exists($plugins_path . 'install/install.php')) {
        @header("Content-Type: text/html; charset=utf-8");
        die("F2blog isn't install success, the reason is: <br>1. Install file 'install/install.php' isn't exists. <br>2. Your mysql setting file 'include/config.php' isn't connect database!<br><br>Please check up the reason.");
    } else {
        header("Location: install/install.php");
    }
}
// 连结数据库
$DMF = new DummyMySQLClass($DBHost, $DBUser, $DBPass, $DBName, $DBNewlink);
//检测是否安装了,如果连接数据库正常表示安装成功了。
if (!$DMF->query("select id from " . $DBPrefix . "keywords limit 0,1")) {
    if (!file_exists($plugins_path . 'install/install.php')) {
        @header("Content-Type: text/html; charset=utf-8");
        die("F2blog isn't install success, the reason is: <br>1. Install file 'install/install.php' isn't exists. <br>2. Your mysql setting file 'include/config.php' isn't connect database!<br><br>Please check up the reason.");
    } else {
        header("Location: install/install.php");
    }
} else {
    //如果不存在cache,则重新建立Cache。
    if (!file_exists($plugins_path . "cache/cache_modules.php")) {
        reAllCache();
    }
}
//装载设定文件。
예제 #4
0
require_once "admin_config.php";
require_once "{$PATH}/include/cache.php";
require_once "{$PATH}/include/config.php";
require_once "{$PATH}/include/db.php";
require_once "{$PATH}/include/common.php";
//如果设定config.php文件,则安装。
if ($DBUser == "" || $DBPass == "" || $DBName == "") {
    if (!file_exists("{$PATH}/install/install.php")) {
        @header("Content-Type: text/html; charset=utf-8");
        die("F2blog isn't install success, the reason is: <br>1. Install file 'install/install.php' isn't exists. <br>2. Your mysql setting file 'include/config.php' isn't connect database!<br><br>Please check up the reason.");
    } else {
        header("Location: {$PATH}/install/install.php");
    }
}
/********** Connect Database **********/
$DMC = new DummyMySQLClass($DBHost, $DBUser, $DBPass, $DBName, $DBNewlink);
//检测是否安装了,如果连接数据库正常表示安装成功了。
if (!$DMC->query("select id from " . $DBPrefix . "keywords limit 0,1")) {
    if (!file_exists("{$PATH}/install/install.php")) {
        @header("Content-Type: text/html; charset=utf-8");
        die("F2blog isn't install success, the reason is: <br>1. Install file 'install/install.php' isn't exists. <br>2. Your mysql setting file 'include/config.php' isn't connect database!<br><br>Please check up the reason.");
    } else {
        header("Location: {$PATH}/install/install.php");
    }
} else {
    //如果不存在cache,则重新建立Cache。
    if (!file_exists("{$PATH}/cache/cache_modules.php")) {
        reAllCache();
    }
}
//装载设定文件。