+ 1
always outputs:"Пароль введен не верно"
<?php require "db.php"; $data = $_POST; if( isset($data['do_login'])) { $errors = array(); $user = R::findOne('user', 'login = ?', array($data['login'])) ; if('user') { if( password_verify($data['password'], $user->passwords ) ) { echo 'Вы авторизованы'; } else { $errors[] = 'Пароль введен не верно'; } } else { $errors[] = 'Логин введен не верно' ; } } if( ! empty($errors)) { echo '<div style="color: red;">'.array_shift($errors).'</div><hr>'; } ?
2 Answers
+ 3
Try to write by echo the variables to be sure
+ 2
Obviously your password_verify function is return always false so function is wrong and/or data to compare always are different