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

@@ -7,9 +7,9 @@ service mysql start
echo "[ INFO ] Starting PHP 7.2 Service"
service php7.2-fpm start
# Running friendBook database setup script
echo "[ INFO ] Setting up friendBook database"
mysql -u root < /scripts/friendBook.sql
# Running friendbook database setup script
echo "[ INFO ] Setting up friendbook database"
mysql -u root < /scripts/friendbook.sql
echo "[ INFO ] Starting nginx"
nginx -g "daemon off;" # Foreground

View File

@@ -1,4 +1,4 @@
USE friendBook;
USE friendbook;
CREATE TABLE login(
username varchar(25),

View File

@@ -13,7 +13,7 @@ EOF
# Setting up the basics
mysql -u root << EOF
CREATE USER 'web'@'localhost' IDENTIFIED BY 'Password456';
CREATE DATABASE friendBook;
GRANT ALL PRIVILEGES ON friendBook . * TO 'web'@'localhost';
CREATE DATABASE friendbook;
GRANT ALL PRIVILEGES ON friendbook . * TO 'web'@'localhost';
FLUSH PRIVILEGES;
EOF

4
var/www/common.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
session_start();
require 'db_connection.php';
?>

View File

@@ -1,6 +1,6 @@
<?php
$db_server = "localhost";
$db_name = "friendBook";
$db_name = "friendbook";
$db_username = "web";
$db_password = "Password456";

View File

@@ -1,21 +1,17 @@
<?php
session_start();
require 'db_connection.php';
require 'common.php';
?>
<!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 Friends</title>
<title>friendbook Friends</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" -->
<!--#include virtual="topNavBar.html" -->
<?php
try{
echo '<pre>';

5
var/www/header.html Normal file
View File

@@ -0,0 +1,5 @@
<svg height="45" width="100%">
<a xlink:href="#">
<text x="45%" y="40" font-size="40" fill="white">friendbook</text>
</a>
</svg>

After

Width:  |  Height:  |  Size: 144 B

View File

@@ -1,7 +1,7 @@
<!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</title>
<title>friendbook</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"/>
</head>
@@ -11,7 +11,7 @@
background-color: #3B5998;
}
</style>
<h2><font color="white">Friendbook</h2>
<h2><font color="white">friendbook</h2>
<button type="button" onclick="window.location.href = '/friends.html'">See Friends</button>
<br><br>

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>

View File

@@ -1,27 +1,25 @@
<?php
session_start();
require 'common.php';
unset($_SESSION['loggedInUser']);
?>
<!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 Logout</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"/>
</head>
<head>
<title>friendbook Logout</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="styling.css">
</head>
<body>
<?php
session_unset(); // remove all session variables
session_destroy(); // destroy the session
?>
<style>
body {
background-color: #3B5998;
}
</style>
<h2><font color="white">You have been successfully logged out.</h2>
<button type="button" onclick="window.location.href = 'friends.html'">Login again? (FIXME)</button>
<!--#include virtual="header.html" -->
<div class="message">
<p>You have been logged out.</p>
<p>Thank you for using friendbook!</p>
<br /><br />
<a href="/login.php" class="button">Login again?</a>
</div>
</body>
</html>
</html>
<?php
$db_connection = null;
?>

View File

@@ -1,22 +1,16 @@
<?php
session_start();
require 'db_connection.php';
require 'common.php';
?>
<!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 Messages</title>
<title>friendbook Messages</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" -->
<!--#include virtual="topNavBar.html" -->
<?php
try{

View File

@@ -7,7 +7,7 @@ body
background-color: #3B5998;
}
</style>
<h2><font color="white">Friendbook</h2>
<h2><font color="white">friendbook</h2>
<?php

View File

@@ -1,16 +1,31 @@
body {
background-color: #3B5998;
color: white;
}
.button a {
/* font: bold 11px Arial;*/
text-decoration: none;
background-color: #EEEEEE;
color: #333333;
padding: 2px 6px 2px 6px;
border-top: 1px solid #CCCCCC;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #CCCCCC;
}
.topNavBar {
background-color: #333;
background-color: rgb(236, 236, 236);
overflow: hidden;
}
.topNavBar a {
float: left;
color: #f2f2f2;
color: #363636;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topNavBar a:hover {
background-color: #ddd;
color: black;
background-color: rgb(44, 48, 255);
color: rgb(255, 255, 255);
}

View File

@@ -1,10 +1,10 @@
<div class="topNavBar">
<a href="/friends.php">See Friends</a>
<a href="messages.php">See Messages</a>
<a href="search.php">Search</a>
<a href="sendMessage.php">Message Someone</a>
<a href="findFriend.html">Find a New Friend</a>
<a href="pendingFriend.html">Check Pending Friends</a>
<a href="/messages.php">See Messages</a>
<a href="/search.php">Search</a>
<a href="/sendMessage.php">Message Someone</a>
<a href="/findFriend.html">Find a New Friend</a>
<a href="/pendingFriend.html">Check Pending Friends</a>
<!--Maybe show the user's name here?-->
<a href="#" style="float:right">Logout</a>
<a href="/logout.php" style="float:right">Logout</a>
</div>