From 5a4665128815232eca6839a3f4771596c0c2cad4 Mon Sep 17 00:00:00 2001 From: ry1015 Date: Sun, 2 Nov 2014 14:23:11 -0800 Subject: [PATCH] Added new php files --- functions.php | 27 +++++++++++++++++++++++++++ header.php | 26 +++++++++++++++++++++----- index.php | 1 + styles.css | 14 ++++++++++++++ 4 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 functions.php diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..32867c3 --- /dev/null +++ b/functions.php @@ -0,0 +1,27 @@ +connect_error) die ($connection->connect_error); + + function queryMysql($query){ + global $connection; + $result = $connection->query($query); + if (!$result) die ($connection->error); + + return $result; + } + + function destroySession(){ + $_SERVER = array(); + + if (session_id() != "" || isset($_COOKIE[session_name()])) + setcookie (session_name (), '', time() - 2592000, '/'); + + session_destroy(); + } +?> \ No newline at end of file diff --git a/header.php b/header.php index 9d4da61..056d512 100644 --- a/header.php +++ b/header.php @@ -1,11 +1,27 @@ - - F8L Online Banking - - - + +_END; + +require_once 'functions.php'; + +$userstr = " (Guest)"; + +if (isset($_SESSION['user'])){ + $user = $_SESSION['user']; + $loggedin = TRUE; + $userstr = " ('$user')"; +} else { + $loggedin = FALSE; +} + +echo <<<_END + F8L Online Banking + + + _END; ?> diff --git a/index.php b/index.php index 816839e..60fe5fe 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,7 @@ require_once 'header.php'; echo <<<_END +
HELLO WORLD!!
_END; diff --git a/styles.css b/styles.css index e69de29..267d0bc 100644 --- a/styles.css +++ b/styles.css @@ -0,0 +1,14 @@ +* { + font-family:verdana,sans-serif; + font-size :14pt; +} + +body{ + width: 700px; + margin: 20px auto; + color: white; +} + +html{ + background-color: aqua; +} \ No newline at end of file