exists()) { header('Location: signin.php'); $_SESSION['message'] = 'Bad password'; exit(); } $_SESSION['login'] = $login; header('Location: welcome.php'); } catch(Exception $e) { $_SESSION['message'] = $e->getMessage(); header('Location: signin.php'); exit(); } } else { header('Location: signin.php'); }