Fixes and cleanup

This commit is contained in:
William Miceli
2019-12-03 22:53:52 -05:00
parent 393b9e8725
commit e93827e46f
3 changed files with 7 additions and 26 deletions

View File

@@ -14,17 +14,16 @@
$_SESSION['loggedInUser'] = $_POST['login_username'];
unset($_SESSION['loginError']);
// Move onto landing page
// header('Location: /landingPage.html');
// header('Location: /landingPage.html');
}else{
// No matching users found, send user error
// No matching users found, send user an error message
$_SESSION['loginError'] = 'Invalid Username or Password';
// Return to login page
// header("Location: /login.php");
}
}else{
// Return to login page, as credentials were not captured
$_SESSION["loginError"] = "Username and Password are required, please try again";
// header("Location: /login.php");
// If user submitted login form wihout actually filling it out completely, send user an error message
if(!empty($_POST)){
$_SESSION["loginError"] = "Username and Password are required, please try again";
}
}
}catch(PDOException $e){
echo "PDOException: ".$e->getMessage();
@@ -53,12 +52,6 @@
<input type="password" name="login_password" placeholder="Password"><br />
<input type="submit">
</form>
<?php
echo '<h3>$GLOBALS</h3>';
echo '<pre>';
print_r($GLOBALS);
echo '</pre>';
?>
</body>
</html>
<?php