+ 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>'; } ?

28th Oct 2017, 8:27 PM
Kirill Chistyakov
Kirill  Chistyakov - avatar
2 Réponses
+ 3
Try to write by echo the variables to be sure
15th Nov 2017, 1:30 AM
Daniel
Daniel - avatar
+ 2
Obviously your password_verify function is return always false so function is wrong and/or data to compare always are different
15th Nov 2017, 1:29 AM
Daniel
Daniel - avatar