Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. if (isset($_POST["Submit"])) {
  4.     $getHashDb = $con->prepare("SELECT id, username, password FROM admin_registration WHERE username = ? ");
  5.     $getHashDb->bind_param("s", $_POST['Username']);
  6.     $getHashDb->execute();
  7.     $getHashDb->bind_result($id, $username, $password);
  8.     $getHashDb->fetch();
  9.    
  10.     var_dump($password);
  11.  
  12.     if (password_verify($_POST['Password'], $password)) {
  13.         $_SESSION["User_Id"] = $id;
  14.         $_SESSION["Username"] = $username;
  15.         $_SESSION["SuccessMessage"] = "Login Successful! Welcome {$_SESSION["Username"]}";
  16.         Redirect_to("blog_admin/dashboard.php");
  17.     } else {
  18.         $_SESSION["ErrorMessage"] = "Username or Password was incorrect";
  19.         Redirect_to("admin_login.php");
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement