示例#1
0
文件: step_2.php 项目: chaobj001/tt
        }
        if (!$conn) {
            $error = TRUE;
            $errmsg = 'Cannot connect - please check host, username and password.';
        }
    }
    if (!$error) {
        $dbs = my_mysql_select_db($s['MYSQL_DBNAME'], $conn);
        if (!$dbs) {
            $error = TRUE;
            $errmsg = 'Database does not exist.';
        }
    }
    if (!$error && !$is_upgrade) {
        $tbl = my_mysql_query('SHOW TABLES FROM ' . $s['MYSQL_DBNAME'], $conn);
        if ($tbl && my_mysql_num_rows($tbl) > 0) {
            $error = TRUE;
            $errmsg = 'Database must be empty - this one contains one or more tables.';
        }
    }
    if (!$error) {
        $_SESSION['INSTALL_STEP'] = 2;
        header('Location: ?next&r=' . rand(0, 99999));
    }
}
$html .= '
							<div class="ttl">
								<div class="ttl2">
									<h3>Database Settings</h3>
								</div>
							</div>
示例#2
0
文件: step_7.php 项目: chaobj001/tt
    if (!$error && strlen($s['ADMIN_PASS']) < 5) {
        $error = TRUE;
        $errmsg = 'Password must be at least 5 characters long.';
    }
    if (!$error && $s['ADMIN_PASS'] != $s['ADMIN_PASS2']) {
        $error = TRUE;
        $errmsg = 'Passwords don`t match.';
    }
    if (!$error && !is_valid_email($s['ADMIN_EMAIL'])) {
        $error = TRUE;
        $errmsg = 'Invalid E-mail address.';
    }
    if (!$error) {
        $res = my_mysql_query('SELECT id FROM users WHERE email="' . addslashes($s['ADMIN_EMAIL']) . '" LIMIT 1', $conn);
        if ($res) {
            if (my_mysql_num_rows($res) > 0) {
                $error = TRUE;
                $errmsg = 'This e-mail is already registered.';
            }
        }
    }
    if (!$error) {
        unset($s['ADMIN_PASS2']);
        $_SESSION['INSTALL_STEP'] = 7;
        header('Location: ?next&r=' . rand(0, 99999));
    }
}
$html .= '
							<div class="ttl">
								<div class="ttl2">
									<h3>Administrative Account</h3>