require "libs/rb.php";
if(isset($_POST['do_login'])){
$err = array();
$users = R::findOne('users', 'login = ?', array($_POST['login']));
if($user){
if(password_verify($_POST['password'], $user->password)){
$_SESSION['log_successfuly'] = $users;
header('Location: index.php');
} else{
$err[] = 'Пароль введен неверно!';
}
}else{
$err[] = 'Пользователь с таким логином не найден!';
}
if(!empty($err)){
echo '<div style="color: red; ">' . array_shift($err). '</div><hr>';
}
}
// Fatal error: Uncaught Error: Call to a member function findOne() on null in C:\Users\muha\Downloads\OpenServer\domains\reg\libs\rb.php:13922 Stack trace: #0 C:\Users\muha\Downloads\OpenServer\domains\reg\login.php(5): RedBeanPHP\Facade::findOne() #1 {main} thrown in
Cannot declare interface RedBeanPHP\Logger, because the name is already in use in C:\Users\muha\Downloads\OpenServer\domains\reg\libs\rb-mysql.php on line 19