Guest User

login.php

a guest
Sep 28th, 2016
174
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. if($_SERVER['REQUEST_METHOD']=='POST'){
  4. //Getting values
  5. $username = $_POST['user_login'];
  6. $password = $_POST['password'];
  7. require_once('passwordhash.php');
  8. require_once('dbConnect.php');
  9. $wp_hasher = new PasswordHash(16, true);
  10. $pass = $wp_hasher->HashPassword( trim( $posted['password'] )
  11.  
  12. );
  13.  
  14. $strSql = "SELECT user_pass FROM wp_users WHERE user_login = '$username'";
  15. $result = mysql_query($strSql);
  16. $row = mysql_fetch_array($result);
  17. $password_hashed = $user['password'];
  18.  
  19.  
  20.  
  21. if($wp_hasher->CheckPassword($pass, $password_hashed)) {
  22. echo "Yes password is correct" ;
  23. } else {
  24. echo "Entered Password is wrong";
  25. }
  26. mysqli_close($con);
  27. }
RAW Paste Data