Made things look a little nicer

This commit is contained in:
William Miceli
2019-12-03 22:24:42 -05:00
parent dff8bd9306
commit 4139767a22
14 changed files with 77 additions and 70 deletions

View File

@@ -1,6 +1,5 @@
<?php
session_start();
require 'db_connection.php';
require 'common.php';
try{
if($_POST['login_username'] != '' && $_POST['login_password'] != ''){
@@ -15,17 +14,17 @@
$_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
$_SESSION['loginError'] = 'Invalid Username or Password';
// Return to login page
// header("Location: /login.php");
// 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");
// header("Location: /login.php");
}
}catch(PDOException $e){
echo "PDOException: ".$e->getMessage();
@@ -37,16 +36,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>FriendBook Login</title>
<title>friendbook Login</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="styling.css">
</head>
<body>
<style>
body {
background-color: #3B5998;
color: white;
}
</style>
<!--#include virtual="header.html" -->
<div class="message">
<p><?php if($_SESSION['loginError']!=""){ echo $_SESSION['loginError']; } ?></p>
</div>