php - password_verify function is not working -


i trying use password_verify in php compare hashed password in database user input put doesn't work.

this code :

if (isset($_post['login'])){         $usrname = $_post['uname'];         $usrpass = $_post['password'];         $_session['usr'] = $usrname;         $sql = "select * users usrname = '".$usrname."'";         $result = mysql_query($sql);         if (!$result)die('invalid query: ' . mysql_error());         else{             while($row = mysql_fetch_array($result))                 {$pass=$row[2];}         }     $verify=password_verify($usrpass,$pass);     if($verify){         echo("<script>location.href = 'index.php';</script>");     } else {         echo "<h1>{user , password combination doesn't exist}</h1>";     } } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -