From 50f196849b3f963556ece67c0d44ed8f92588703 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Mon, 27 Feb 2023 13:15:43 +0100 Subject: [PATCH] v4 added, php boilerplate added --- v4/.htaccess | 9 +++++ v4/Dockerfile | 0 v4/css/style.css | 12 ++++++ v4/index.php | 88 ++++++++++++++++++++++++++++++++++++++++++ v4/pages/home/home.php | 2 + v4/pages/test/test.php | 3 ++ 6 files changed, 114 insertions(+) create mode 100644 v4/.htaccess create mode 100644 v4/Dockerfile create mode 100644 v4/css/style.css create mode 100644 v4/index.php create mode 100644 v4/pages/home/home.php create mode 100644 v4/pages/test/test.php diff --git a/v4/.htaccess b/v4/.htaccess new file mode 100644 index 0000000..b9d3b28 --- /dev/null +++ b/v4/.htaccess @@ -0,0 +1,9 @@ +RewriteEngine On +Options -Indexes +RewriteBase / + +# index.php?page=neco => neco/ +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^([^/]+)/?$ ?page=$1 + diff --git a/v4/Dockerfile b/v4/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/v4/css/style.css b/v4/css/style.css new file mode 100644 index 0000000..9610dc2 --- /dev/null +++ b/v4/css/style.css @@ -0,0 +1,12 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +.nav { + display: flex; + +} + + diff --git a/v4/index.php b/v4/index.php new file mode 100644 index 0000000..df42df1 --- /dev/null +++ b/v4/index.php @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <?= $title ?> + + + + 0) { + echo("

Upozornění

Nelze nahrát soubor v nadřazeném adresáři."); + } + elseif($file == "index" || $file == "/index") { + echo("

Upozornění

Index nemůže načíst sám sebe."); + } else { + require_once($file2); + } + } + else { + require_once("./pages/error_404.php"); + } +} +else { + require_once("./pages/home/home.php"); +} +?> + + + diff --git a/v4/pages/home/home.php b/v4/pages/home/home.php new file mode 100644 index 0000000..3169a52 --- /dev/null +++ b/v4/pages/home/home.php @@ -0,0 +1,2 @@ +

Home

+test

diff --git a/v4/pages/test/test.php b/v4/pages/test/test.php new file mode 100644 index 0000000..dee2107 --- /dev/null +++ b/v4/pages/test/test.php @@ -0,0 +1,3 @@ +

Test

+
home +