Exemplo n.º 1
0
} elseif ($sysact == "admin_ok") {
    $user = safe_html($user);
    $pass = safe_html($pass);
    $email = safe_html($email);
    if (!$user) {
        error("管理员账号不能为空", "admin");
    }
    if (!$pass) {
        error("管理员密码不能为空", "admin");
    }
    if (!file_exists("config.php")) {
        error("config.php配置文件不存在,请返回修改", "setconfig", "设置config.php文件");
    }
    if (!file_exists("install.sql")) {
        error("install.sql 文件不存在,请上传...", "incsql", "下一步");
    }
    include_once "config.php";
    include_once "class/db/mysql.php";
    $DB = new DB_SQL($dbHost, $dbUser, $dbPass);
    $DB->Connect($dbData);
    $DB->Query("TRUNCATE TABLE `" . $prefix . "admin`");
    $sql = "INSERT INTO " . $prefix . "admin(typer,user,pass,email) VALUES('system','" . $user . "','" . md5($pass) . "','" . $email . "')";
    $DB->Query($sql);
    error("管理员设置成功", "setlock", "下一步");
} elseif ($sysact == "setlock") {
    @touch("data/lock.php");
    error("恭喜您,PHPOK3.0精简版企业站程序已安装成功<br /><br />感谢您使用PHPOK3.0精简版企业站程序,祝您事业进步,万事顺心!", "toindex", "进入首页");
} elseif ($sysact == "toindex") {
    ob_end_clean();
    header("Location:index.php");
}