New folder structure

This commit is contained in:
Kilian Hofmann 2024-05-24 11:17:13 +02:00
parent 2c947a0dfa
commit a20226595b
10 changed files with 17 additions and 103 deletions

View File

@ -1,3 +1,7 @@
<meta charset="utf-8" />
<meta name="author" content="Kilian Kurt Hofmann" />
<meta name="copyright" content="Kilian Kurt Hofmann" />
<meta name="robots" content="noindex" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

View File

@ -1,6 +1,6 @@
<?php
include_once "../../base/errors.php";
include_once "../../base/headers.php";
include_once "../../../base/errors.php";
include_once "../../../base/headers.php";
session_start();
$_SESSION["error"] = [];
@ -35,11 +35,11 @@ if (count($_SESSION["error"]) > 0) {
return;
}
$string = file_get_contents("data.json") ?? "[]";
$string = file_get_contents("../data/data.json") ?? "[]";
$json = json_decode($string);
array_push($json, ["time" => $time, "title" => $title, "name" => $name, "comment" => $comment]);
file_put_contents("data.json", json_encode($json));
file_put_contents("../data/data.json", json_encode($json));
Headers::redirect(".");
Headers::redirect("../");

View File

@ -1,7 +1,7 @@
<div class="col">
<div class="card h-100">
<div class="card-header">
<h5 class="card-title text-truncate"><?= $comment->title ?></h5>
<h5 class="card-title lh-base text-truncate"><?= $comment->title ?></h5>
<h6 class="card-subtitle mb-2 text-muted"><?= $comment->name ?></h6>
</div>
<div class="card-body">

View File

@ -1,4 +1,4 @@
<form action="comment.php" method="post" class="needs-validation row m-0" novalidate>
<form action="./actions/comment.php" method="post" class="needs-validation row m-0" novalidate>
<div class="col">
<h4 class="mb-3">Leave a Comment!</h4>
<div class="mb-3">

View File

@ -1,93 +0,0 @@
[
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{
"time": 1715337098,
"title": "The first",
"name": "Kilian",
"comment": "The first comment on here."
},
{ "time": 1715338381, "title": "sdf", "name": "dsaf", "comment": "dsg" },
{
"time": 1715339761,
"title": "Witzige Aufgabe",
"name": "Kilian",
"comment": "nun ja, also das funktioniert ja schon recht gut gell."
},
{
"time": 1716539658,
"title": "Progress Bar",
"name": "Kilian",
"comment": "Jetzt auch mit einem etwas geileren Progress Bar der einem die Character-Anzahl anzeigt.\r\nWesentlich geiler, wesentlich nicer, und Bootstraped"
}
]

View File

@ -0,0 +1,2 @@
DENY FROM ALL
ALLOW FROM 127.0.0.1

View File

@ -0,0 +1 @@
[{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715337098,"title":"The first","name":"Kilian","comment":"The first comment on here."},{"time":1715338381,"title":"sdf","name":"dsaf","comment":"dsg"},{"time":1715339761,"title":"Witzige Aufgabe","name":"Kilian","comment":"nun ja, also das funktioniert ja schon recht gut gell."},{"time":1716539658,"title":"Progress Bar","name":"Kilian","comment":"Jetzt auch mit einem etwas geileren Progress Bar der einem die Character-Anzahl anzeigt.\r\nWesentlich geiler, wesentlich nicer, und Bootstraped"},{"time":1716541941,"title":"New layout","name":"Kilian","comment":"New folder structure"}]

View File

@ -6,8 +6,8 @@
<title>Guest Book</title>
<script src="formValidation.js"></script>
<script src="textarea.js"></script>
<script src="./js/formValidation.js"></script>
<script src="./js/textarea.js"></script>
</head>
<body>
@ -22,7 +22,7 @@
$errors = $_SESSION["error"] ?? [];
$_SESSION["error"] = [];
$string = file_get_contents("data.json") ?? "[]";
$string = file_get_contents("./data/data.json") ?? "[]";
$json = array_reverse(json_decode($string));
if (isset($_GET["p"]) && !is_numeric($_GET["p"])) {