Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. $username = strtolower(preg_replace("/[^A-Za-z0-9]/","", $_POST['username']));
  2. $password = sha1($_POST['password']);
  3.  
  4. ------------------------------------------------------------------------------
  5.  
  6.  
  7. $pwdchk =
  8. "
  9. SELECT * FROM userstbl WHERE username = '$username'
  10. ";
  11.  
  12. $result = mssql_query($pwdchk);
  13.  
  14. while($row = mssql_fetch_array($result))
  15. {
  16. if ($row['salt'] . sha1($_POST['password']) == $row['saltedpassword'])
  17. {
  18. echo "Successfully logged in";
  19. }
  20.  
  21.  
  22.  
  23. if ($row['salt'] . sha1($_POST['password']) != $row['saltedpassword'])
  24. {
  25. echo "The password you used is incorrect.";
  26. echo "<br /><br />";
  27. echo $row['saltedpassword'];
  28. echo "<br /><br />";
  29. echo ($row['salt'] . sha1($_POST['password']));
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement