Misc code cleanups and comment.
[Project_webapp.git] / includes / formlogin.php
index ed17f8069d80b075a3fb1b876ccba14071b1f87f..b07ad4eb3c0303ed17c6fcbe812da28732fa4429 100644 (file)
@@ -4,6 +4,7 @@ $form_password = filter_input(INPUT_POST, "password", FILTER_SANITIZE_STRING);
 
 if (!$form_email) {
     echo "The email is not valid. <br>";
+    redirect("index.php?page=login", 3);
 } elseif (isset($form_email) && isset($form_password)) {
     if (chk_account($form_email)) {
         if (chk_password($form_email, $form_password)) {
@@ -24,7 +25,7 @@ if (!$form_email) {
         redirect("index.php?page=register", 3);
     }
 } else {
-    // didn't authenticate, go back to login form
-    echo "Fail to authenticate. <br>";
+    // didn't authenticate for unknown reason, go back to login form
+    echo "Fail to authenticate for unknown reason. <br>";
     redirect("index.php?page=login", 3);
 }