New folder structure
This commit is contained in:
@@ -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("../");
|
||||
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,2 @@
|
||||
DENY FROM ALL
|
||||
ALLOW FROM 127.0.0.1
|
||||
@@ -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"}]
|
||||
@@ -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"])) {
|
||||
|
||||
Reference in New Issue
Block a user