function userconnect($username, $password) { $encryptedpassword = sha1($password); $sql = "SELECT * FROM user WHERE user_nickname='" . $username . "'AND user_password='******'"; $stmt = dbconnection()->prepare($sql); $stmt->execute(); $result = $stmt->fetch(); if ($result != false) { session_start(); $_SESSION['user_level'] = $result['user_level']; $_SESSION['user_name'] = $result['user_nickname']; header('Location: data.php'); exit; } else { $error = '<div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="sr-only"></span> Vos données de login sont incorrectes !! </div>'; return $error; } }
$rct2->execute(); } else { mysql_unbuffered_query($result); } } } } } if (count($_POST['list_ins'])) { foreach ($results as $result) { if (preg_match("/INSERT INTO `(.*?)`/i", $result, $tmp)) { $ins = $tmp[1]; if (in_array($ins, $_POST['list_ins'])) { $result = preg_replace("/INSERT INTO `{$inf_tblpre}(.*?)`/i", "INSERT INTO `{$restore_tblpre}\\1`", $result); if ($pdo_enabled == "1") { $rct3 = dbconnection()->prepare($result, array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE)); $rct3->execute(); } else { mysql_unbuffered_query($result); } } } } } addNotice("success", $locale['404']); //@unlink(ADMIN."db_backups/temp.txt"); redirect(FUSION_SELF . $aidlink); } else { opentable($locale['400']); openform("frm_info", "post", FUSION_SELF . $aidlink); echo "<div class='text-center list-group-item'>\n";
/** * Get the last inserted auto increment id * @return int */ function dblastid() { return (int) dbconnection()->lastInsertId(); }
/** * Fetch the settings from the database * @param string $key The key of one setting * @return string[]|string Associative array of settings or one setting by key * if $key was given */ function fusion_get_settings($key = NULL) { // It is initialized only once because of 'static' static $settings = array(); if (empty($settings) and defined('DB_SETTINGS') and dbconnection()) { $result = dbquery("SELECT * FROM " . DB_SETTINGS); while ($data = dbarray($result)) { $settings[$data['settings_name']] = $data['settings_value']; } } return $key === NULL ? $settings : (isset($settings[$key]) ? $settings[$key] : NULL); }
} //Generating navigation $navigation = "<table class='table table-responsive' style='text-align:center; margin-bottom:1em;'>\n<tr>\n"; $navigation .= "<td class='" . ($_GET['page'] == 1 ? "tbl1" : "tbl2") . "' style='width:25%'>" . ($_GET['page'] == 1 ? "<strong>" : "") . "<a href='" . FUSION_SELF . $aidlink . "&page=1'>" . $locale['401'] . "</a>" . ($_GET['page'] == 1 ? "</strong>" : "") . "</td>\n"; $navigation .= "<td class='" . ($_GET['page'] == 2 ? "tbl1" : "tbl2") . "' style='width:25%'>" . ($_GET['page'] == 2 ? "<strong>" : "") . "<a href='" . FUSION_SELF . $aidlink . "&page=2'>" . $locale['420'] . "</a>" . ($_GET['page'] == 2 ? "</strong>" : "") . "</td>\n"; $navigation .= "<td class='" . ($_GET['page'] == 3 ? "tbl1" : "tbl2") . "' style='width:25%'>" . ($_GET['page'] == 3 ? "<strong>" : "") . "<a href='" . FUSION_SELF . $aidlink . "&page=3'>" . $locale['440'] . "</a>" . ($_GET['page'] == 3 ? "</strong>" : "") . "</td>\n"; $navigation .= "<td class='" . ($_GET['page'] == 4 ? "tbl1" : "tbl2") . "' style='width:25%'>" . ($_GET['page'] == 4 ? "<strong>" : "") . "<a href='" . FUSION_SELF . $aidlink . "&page=4'>" . $locale['450'] . "</a>" . ($_GET['page'] == 4 ? "</strong>" : "") . "</td>\n"; $navigation .= "</tr></table>\n"; //General info if ($_GET['page'] == 1) { $phpinfo = "<table class='table table-responsive table-hover table-striped' style='width:100%;' id='folders'>\n"; $phpinfo .= "<tr>\n<td class='tbl2' style='width:20%'>" . $locale['402'] . "</td><td class='tbl2' style='text-align:right'>" . php_uname() . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl1' style='width:20%'>" . $locale['403'] . "</td><td class='tbl1' style='text-align:right'>" . $_SERVER['SERVER_SOFTWARE'] . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl2' style='width:20%'>" . $locale['404'] . "</td><td class='tbl2' style='text-align:right'>" . phpversion() . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl1' style='width:20%'>" . $locale['405'] . "</td><td class='tbl1' style='text-align:right'>" . php_sapi_name() . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl2' style='width:20%'>" . $locale['406'] . "</td><td class='tbl2' style='text-align:right'>" . dbconnection()->getServerVersion() . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl1' style='width:20%'>" . $locale['407'] . "</td><td class='tbl1' style='text-align:right'>" . $settings['version'] . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl2' style='width:20%'>" . $locale['408'] . "</td><td class='tbl2' style='text-align:right'>" . DB_PREFIX . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl1' style='width:20%'>" . $locale['409'] . "</td><td class='tbl1' style='text-align:right'>" . COOKIE_PREFIX . "</td></tr>\n"; $phpinfo .= "<tr>\n<td class='tbl2' style='width:20%'>" . $locale['410'] . "</td><td class='tbl1' style='text-align:right'>" . stripinput($_SERVER['HTTP_USER_AGENT']) . "</td></tr>\n"; $phpinfo .= "</table>\n"; } else { //PHP settings if ($_GET['page'] == 2) { //Check GD version if (function_exists('gd_info')) { $gd_ver = gd_info(); preg_match('/[0-9]+.[0-9]+/', $gd_ver['GD Version'], $gd_ver); } else { $gd_ver = ''; }
/** * Get the last inserted auto increment id * * @global resource $db_connect * @return int */ function dblastid() { return (int) mysql_insert_id(dbconnection()); }
<table> <tr> <td><label>Username:</label></td> <td><input name="username" type="text"></input></td> </tr> <tr> <td><label>Password:</label> </td> <td><input type="password"></input> </td> </tr> <tr> <td></td> <td><button type="submit" onclick="onclk()">Go</button> </td> </tr> </table> <br /> <?php include 'dbconnect.php'; $sql = "SELECT * FROM usertype"; $result = dbconnection($sql); while ($row = mysql_fetch_array($result)) { echo $row['roleID'] . " " . $row['roleName']; echo "<br />"; } ?> </body> </html>