From fe41f57df59c7f2a11d80eaaebf08d3a3a51a6d5 Mon Sep 17 00:00:00 2001
From: h5p9sl <21267024+h5p9sl@users.noreply.github.com>
Date: Thu, 13 May 2021 22:07:11 -0600
Subject: Add error handling
---
signin.php | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
(limited to 'signin.php')
diff --git a/signin.php b/signin.php
index 2c43309..c38845d 100644
--- a/signin.php
+++ b/signin.php
@@ -17,6 +17,7 @@
';
+ $errstr = 'Please check the following problems:
';
foreach ($errors as $err) {
- echo '- ' . $err . '
';
+ $errstr .= '- ' . $err . '
';
}
- echo '
';
+ $errstr .= '';
+ trigger_error($errstr);
} else {
$user = new User();
$result = $user->get_by_name($user_name);
if (!$result) {
- echo 'There is no user with that name. Did you mean to create a new account?';
+ trigger_error('There is no user with that name. Did you mean to create a new account?');
} else {
if (!password_verify($user_pass, $user->password)) {
echo 'Password does not match!';
--
cgit v1.2.3