exit; } else { $controller->NewUser($log, $pass, $name, ""); mail($to, $subject, $message, $headers); $_SESSION['success'] = 'Successfully! Please check your email for login and password!'; header('Location: /views/auth.php'); exit; } } if (empty($_POST['login']) || empty($_POST['password'])) { $_SESSION['errors'] = 'Login or password is empty!'; header('Location: /views/auth.php'); exit; } $login = $_POST['login']; $password = $_POST['password']; if (!$controller->isExistUser($login, $password)) { $_SESSION['errors'] = 'Wrong login or password'; header('Location: /views/auth.php'); exit; } if (!empty($_POST['remember'])) { $controller->rememberUser($login); $controller->authUser($login, $password); header('Location: /index.php'); exit; } else { $controller->authUser($login, $password); header('Location: /index.php'); exit; }