From d6baa603dc098f85835f947e668e81144f7d2415 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 11 Sep 2021 20:12:29 +0200 Subject: [PATCH] Commit --- example.php | 14 ++++++++------ index.php | 3 --- login.php | 8 ++------ template/_footer.php | 5 ++++- template/_header.php | 10 ++++++---- template/templateParameters.php | 11 +++++++++++ 6 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 template/templateParameters.php diff --git a/example.php b/example.php index 3a59d3d..6d199ad 100644 --- a/example.php +++ b/example.php @@ -1,15 +1,17 @@ -

Eksempel side

-

Dette er en eksempel side

+ +

Eksempel side.

+

Dette er en eksempel side

+ @@ -12,6 +10,5 @@ include_once("template/_header.php"); Bilde av folk som løper på banen \ No newline at end of file diff --git a/login.php b/login.php index 0eb9b52..2ea2b5e 100644 --- a/login.php +++ b/login.php @@ -3,7 +3,7 @@ if ((isset($_POST['username'])) && (isset($_POST['password']))) { if (($_POST['username'] === 'VG3') && ($_POST['password'] === '3ELDEA')) { session_start(); - $_SESSION['logged_in'] = true; + $_SESSION['logged_in'] = TRUE; $_SESSION['username'] = $_POST['username']; header("Location: index.php"); exit; @@ -13,10 +13,8 @@ if ((isset($_POST['username'])) && (isset($_POST['password']))) { } } -// Parameters that will be used in the template file -$templateParameters["title"] = "Logg inn"; // Sets the page title +$templateParameters["title"] = "Logg inn"; -// Include the top of page include_once("template/_header.php"); ?>

Logg inn

@@ -27,7 +25,6 @@ include_once("template/_header.php"); ?>
-
@@ -41,6 +38,5 @@ include_once("template/_header.php");
\ No newline at end of file diff --git a/template/_footer.php b/template/_footer.php index 6962b21..17ffe3b 100644 --- a/template/_footer.php +++ b/template/_footer.php @@ -1,5 +1,8 @@ diff --git a/template/_header.php b/template/_header.php index f629c0a..c620ce7 100644 --- a/template/_header.php +++ b/template/_header.php @@ -1,5 +1,6 @@ 1)) { $templateUrlPrefix = htmlspecialchars($templateUrlPrefix . DIRECTORY_SEPARATOR); } -if ($templateParameters["render"] === false) { +if ($templateParameters["render"] === FALSE) { return; } ?> @@ -26,7 +27,6 @@ if ($templateParameters["render"] === false) {