Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. if ($_POST['login']){
  2. if ($_POST['username'] && $_POST['password']){
  3. $username = mysqli_real_escape_string($conn, $_POST['username']);
  4. $password = mysqli_real_escape_string($conn,(hash("sha512", $_POST['password'])));
  5. $user = mysqli_fetch_array(mysqli_query($conn, ("SELECT * FROM `login` WHERE `username`='$username'")));
  6. if ($user == '0'){
  7. die("That User Does Not Exist!<a href='login.php'>&larr; Back</a>");
  8. }
  9. if ($user['password'] = $password){
  10. die("Incorrect Password! <a href='login.php'>&larr; Back</a>");
  11. }
  12. $userID = $user['ID'];
  13. die("You Are Now Logged In As $username!");
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement