Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- SESSION_start();
- if (isset($_POST['login'])) {
- include_once 'dbh.inc.php';
- $username = mysqli_real_escape_string($conn, $_POST['username']);
- $password = mysqli_real_escape_string($conn, $_POST['password']);
- //error handler
- if (empty($username) || empty($password)) {
- header("location: ../index.php?Login=empty");
- exit();
- }
- else {
- $sql = "SELECT * FROM users WHERE user_uid='$username'";
- $result = mysqli_query($conn, $sql);
- $resultCheck = mysqli_num_rows($result);
- if ($resultCheck < 1) {
- header("location: ../index.php?Login=Fallss");
- exit();
- }
- else {
- if ($row = mysqli_fetch_assoc($result)) {
- $dehashpwdcheck = password_verify($password, $row['user_pwd']);}
- if ($dehashpwdcheck == false) {
- header("Location: ../index.php?signup=Falls");
- exit();}
- elseif ($dehashpwdcheck == true) {
- $_SESSION['u_id'] = $row['user_id'];
- $_SESSION['u_first'] = $row['user_first'];
- $_SESSION['u_last'] = $row['user_last'];
- $_SESSION['u_email'] = $row['user_email'];
- $_SESSION['u_uid'] = $row['user_uid'];
- header("Location: ../AdminLTE-2.4.2/index.php?signup=yo");
- exit();
- }
- }
- }
- }
- else {
- header("Location: ../index.php");
- exit();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement