Repos header

This commit is contained in:
Kilian Hofmann 2024-05-31 12:49:47 +02:00
parent 0da314a31d
commit c62321f854
8 changed files with 11 additions and 16 deletions

View File

@ -10,12 +10,12 @@ class DB extends PDO
{
$conn = null;
try {
$dataAccess = parse_ini_file($config, true);
$dataAccess = parse_ini_file($config, true)["ZEDAT"];
$conn = new PDO(
"mysql:host={$dataAccess["ZEDAT"]["host"]};dbname={$dataAccess["ZEDAT"]["database"]};charset={$dataAccess["ZEDAT"]["charset"]}",
$dataAccess["ZEDAT"]["user"],
$dataAccess["ZEDAT"]["passwd"],
"mysql:host={$dataAccess["host"]};dbname={$dataAccess["database"]};charset={$dataAccess["charset"]}",
$dataAccess["user"],
$dataAccess["passwd"],
[
PDO::ATTR_PERSISTENT => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,

View File

@ -12,6 +12,7 @@
// PHP
include_once "../../../base/settings.php";
include_once "../../../base/headers.php";
Headers::html();
if (!isset($_COOKIE["validation"])) {
setcookie("validation", "false");
@ -25,8 +26,6 @@
unset($colour);
}
}
Headers::html();
?>
</head>

View File

@ -12,6 +12,7 @@
// PHP
include_once "../../../base/settings.php";
include_once "../../../base/headers.php";
Headers::html();
if (isset($_POST["theme"])) {
$theme = $_POST["theme"];
@ -21,8 +22,6 @@
} else if (isset($_COOKIE["theme"])) {
$theme = $_COOKIE["theme"];
}
Headers::html();
?>
<?php if (isset($theme) && $theme === "black") { ?>

View File

@ -12,6 +12,7 @@
// PHP
include_once "../../base/settings.php";
include_once "../../base/headers.php";
Headers::html();
$fh = fopen("./data/counter.txt", "r+");
if (flock($fh, LOCK_EX)) {
@ -27,8 +28,6 @@
}
flock($fh, LOCK_UN);
fclose($fh);
Headers::html();
?>
<h1>Visitor count: <?= $cnt ?></h1>
</body>

View File

@ -10,6 +10,7 @@
<?php
include_once "../../base/settings.php";
include_once "../../base/headers.php";
Headers::html();
/* Aufgabe 1 (A)
Programmieren Sie eine Funktion buildlink,
@ -121,8 +122,6 @@ Details siehe Aufgabenstellung in Blackboard. */
echo getHits("counter.txt");
addHit("counter.txt");
Headers::html();
?>
</body>

View File

@ -1 +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"},{"time":1716545229,"title":"More consistent padding","name":"Kilian","comment":"More unified padding across the sections of the page"},{"time":1716545296,"title":"Inject","name":"Kilian","comment":"<?php echo \"injection time!\" ?>"},{"time":1716546110,"title":"JS Inject","name":"Kilian","comment":"<script>\r\nconsole.log(\"BAD\");\r\n<\/script\/>"},{"time":1716547636,"title":"Redirect","name":"Kilian","comment":"Correct redirect tag"},{"time":1716547857,"title":"Back to old","name":"Kilian","comment":"302 is apparently more common"}]
[{"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"},{"time":1716545229,"title":"More consistent padding","name":"Kilian","comment":"More unified padding across the sections of the page"},{"time":1716545296,"title":"Inject","name":"Kilian","comment":"<?php echo \"injection time!\" ?>"},{"time":1716546110,"title":"JS Inject","name":"Kilian","comment":"<script>\r\nconsole.log(\"BAD\");\r\n<\/script\/>"},{"time":1716547636,"title":"Redirect","name":"Kilian","comment":"Correct redirect tag"},{"time":1716547857,"title":"Back to old","name":"Kilian","comment":"302 is apparently more common"},{"time":1717152497,"title":"Repositioned HTML Header call","name":"Kilian","comment":"As title says"}]

View File

@ -17,6 +17,7 @@
// PHP
include_once "../../base/settings.php";
include_once "../../base/headers.php";
Headers::html();
session_start();
$errors = $_SESSION["error"] ?? [];
@ -38,8 +39,6 @@
}
$data = array_slice($json, $page * 9, 9);
Headers::html();
?>
<div class="container-fluid p-0">

View File

@ -22,7 +22,7 @@
$stmt = $db->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$result = $stmt->fetchAll();
DB::closeConnection($db);
?>