aboutsummaryrefslogtreecommitdiff
path: root/guestbook
diff options
context:
space:
mode:
Diffstat (limited to 'guestbook')
-rw-r--r--guestbook/guestbook.json104
-rw-r--r--guestbook/guestbook.json.save68
-rw-r--r--guestbook/guestbook.php102
3 files changed, 274 insertions, 0 deletions
diff --git a/guestbook/guestbook.json b/guestbook/guestbook.json
new file mode 100644
index 0000000..317687f
--- /dev/null
+++ b/guestbook/guestbook.json
@@ -0,0 +1,104 @@
+[
+ {
+ "id": 1774121646,
+ "name": "vampqueen",
+ "message": "*bites*",
+ "timestamp": "2026-03-21T19:34:06+00:00"
+ },
+ {
+ "id": 1773434445,
+ "name": "dari",
+ "message": "Meow",
+ "timestamp": "2026-03-13T20:40:45+00:00"
+ },
+ {
+ "id": 1772820601,
+ "name": "bee movie",
+ "message": "According to all known laws of aviation, there is no way a bee should be able to fly.\r\nIts wings are too small to get its fat little body off the ground.\r\nThe bee, of course, flies anyway because bees don't care what humans think is impossible.\r\nYellow, black. Yellow, black. Yellow, black. Yellow, black.\r\nOoh, black and yellow!\r\nLet's shake it up a little.\r\nBarry! Breakfast is ready!\r\nComing!\r\nHang on a second.\r\nHello?\r\nBarry?\r\nAdam?\r\nCan you believe this is happening?\r\nI can't.\r\nI'll pick you u",
+ "timestamp": "2026-03-06T18:10:01+00:00"
+ },
+ {
+ "id": 1772732369,
+ "name": "256phi",
+ "message": "Dear Alien CEO, we still got no fucking clue who you are and so do you regarding us. So do not try scaring us away. We will retaliate.",
+ "timestamp": "2026-03-05T17:39:29+00:00"
+ },
+ {
+ "id": 1772732277,
+ "name": "alien ceo",
+ "message": "joined the conversation : hello 256phi and precious ikea alien named bleep the first we see that u have some problems with each other ( IF IM RIGHT THERES SOME ALIEN ULLYING GOING ON SO WE MUST FIND OUT CUZ PLUSHIE BULLYING IS VERY BAD YK ) \r\nSO WE ARE HERE TO STOP ANYTHING BAD THAT IS BETWEEN U TWO \r\nWITH RESPECT IN HUMANS AND A PRECIOUS IKEA ALIEN PLUSHIE \r\nTHE LEADER OF THE ALIEN CEO AND HIS WORKERS \r\nPS : WE ARE ARMED DONT EVEN THINK U ARE GOING TO DO SOMETHING",
+ "timestamp": "2026-03-05T17:37:57+00:00"
+ },
+ {
+ "id": 1772731960,
+ "name": "bleepo",
+ "message": "well im ur cousins plushie \r\nthe one u like to throw away\r\nout the windowwwwwwwwwwwwwwwwwwwwwwww\r\nbleb\r\nwith love and respect \r\nbleepie",
+ "timestamp": "2026-03-05T17:32:40+00:00"
+ },
+ {
+ "id": 1772731852,
+ "name": "bleepo",
+ "message": "okay no that was mean im sowwy",
+ "timestamp": "2026-03-05T17:30:52+00:00"
+ },
+ {
+ "id": 1772731829,
+ "name": "bleepo",
+ "message": "ur\r\n mom",
+ "timestamp": "2026-03-05T17:30:29+00:00"
+ },
+ {
+ "id": 1772731802,
+ "name": "256phi",
+ "message": "Dear bleepo, with due respect. Who tf are you?!",
+ "timestamp": "2026-03-05T17:30:02+00:00"
+ },
+ {
+ "id": 1772731735,
+ "name": "BLEEPO",
+ "message": "please\r\nstop \r\nthrowing \r\nme \r\ninto \r\nthe \r\ntrash \r\nbin \r\ni hate it there \r\nthis is called plushie diskriminace \r\npwease\r\nstop\r\nor im gonna call my friend the freddy fazbear \r\nhar har har \r\nbe scared\r\nand dont even think ur gonna look into my sketchbook\r\nor\r\nu will get the ultimate punishment for me because i can draw anything i can \r\nso\r\nwe will see if ur gonna be good \r\nor ur going bald",
+ "timestamp": "2026-03-05T17:28:55+00:00"
+ },
+ {
+ "id": 1772731474,
+ "name": "furrykovska_pastelka",
+ "message": "bleb gleep glorp glurp ful bop blep balb gurp garp HEH \r\nOWO FIRP GLIRP GIIP GUP LUB PLUB HUR \r\nUR DEAR IKEA ALIEN ADOPTED IN IKEA, GOT HOME AT 24.12 \r\nPS: STOP BULLYING ME OR I WILL RIP UR PC IN TWO PIECES OR MORE\r\nWITH LOVE \r\nBLEEPO",
+ "timestamp": "2026-03-05T17:24:34+00:00"
+ },
+ {
+ "id": 1772722643,
+ "name": "syn",
+ "message": "arfarfarfarfarfarfarfarfarfarfarf",
+ "timestamp": "2026-03-05T14:57:23+00:00"
+ },
+ {
+ "id": 1772314637,
+ "name": "magnetikk",
+ "message": "wow this website is so h",
+ "timestamp": "2026-02-28T21:37:17+00:00"
+ },
+ {
+ "id": 1772055550,
+ "name": "jade",
+ "message": "banger site, i like, nice !",
+ "timestamp": "2026-02-25T21:39:10+00:00"
+ },
+ {
+ "id": 1772054198,
+ "name": "BlueBlackCat",
+ "message": "meow :3\r\nAlso 265phi u are amazing",
+ "timestamp": "2026-02-25T21:16:38+00:00"
+ },
+ {
+ "id": 1772052817,
+ "name": "Logan D.",
+ "message": "Hi, thanks for having me :3",
+ "timestamp": "2026-02-25T20:53:37+00:00"
+ },
+ {
+ "id": 1772052569,
+ "name": "256phi",
+ "message": "Hello :3",
+ "timestamp": "2026-02-25T20:49:29+00:00"
+ }
+] \ No newline at end of file
diff --git a/guestbook/guestbook.json.save b/guestbook/guestbook.json.save
new file mode 100644
index 0000000..464fd25
--- /dev/null
+++ b/guestbook/guestbook.json.save
@@ -0,0 +1,68 @@
+[
+ {
+ "id": 1772731852,
+ "name": "bleepo",
+ "message": "okay no that was mean im sowwy",
+ "timestamp": "2026-03-05T17:30:52+00:00"
+ },
+ {
+ "id": 1772731829,
+ "name": "bleepo",
+ "message": "ur\r\n mom",
+ "timestamp": "2026-03-05T17:30:29+00:00"
+ },
+ {
+ "id": 1772731802,
+ "name": "256phi",
+ "message": "Dear bleepo, with due respect. Who tf are you?!",
+ "timestamp": "2026-03-05T17:30:02+00:00"
+ },
+ {
+ "id": 1772731735,
+ "name": "BLEEPO",
+ "message": "please\r\nstop \r\nthrowing \r\nme \r\ninto \r\nthe \r\ntrash \r\nbin \r\ni hate it there \r\nthis is called plushie diskriminace \r\npwease\r\nstop\r\nor im gonna call my friend the freddy fazbear \r\nhar har har \r\nbe scared\r\nand dont even think ur gonna look into my sketchbook\r\nor\r\nu will get the ultimate punishment for me because i can draw anything i can \r\nso\r\nwe will see if ur gonna be good \r\nor ur going bald",
+ "timestamp": "2026-03-05T17:28:55+00:00"
+ },
+ {
+ "id": 1772731474,
+ "name": "furrykovska_pastelka",
+ "message": "bleb gleep glorp glurp ful bop blep balb gurp garp HEH \r\nOWO FIRP GLIRP GIIP GUP LUB PLUB HUR \r\nUR DEAR IKEA ALIEN ADOPTED IN IKEA, GOT HOME AT 24.12 \r\nPS: STOP BULLYING ME OR I WILL RIP UR PC IN TWO PIECES OR MORE\r\nWITH LOVE \r\nBLEEPO",
+ "timestamp": "2026-03-05T17:24:34+00:00"
+ },
+ {
+ "id": 1772722643,
+ "name": "syn",
+ "message": "arfarfarfarfarfarfarfarfarfarfarf",
+ "timestamp": "2026-03-05T14:57:23+00:00"
+ },
+ {
+ "id": 1772314637,
+ "name": "magnetikk",
+ "message": "wow this website is so h",
+ "timestamp": "2026-02-28T21:37:17+00:00"
+ },
+ {
+ "id": 1772055550,
+ "name": "jade",
+ "message": "banger site, i like, nice !",
+ "timestamp": "2026-02-25T21:39:10+00:00"
+ },
+ {
+ "id": 1772054198,
+ "name": "BlueBlackCat",
+ "message": "meow :3\r\nAlso 265phi u are amazing",
+ "timestamp": "2026-02-25T21:16:38+00:00"
+ },
+ {
+ "id": 1772052817,
+ "name": "Logan D.",
+ "message": "Hi, thanks for having me :3",
+ "timestamp": "2026-02-25T20:53:37+00:00"
+ },
+ {
+ "id": 1772052569,
+ "name": "256phi",
+ "message": "Hello :3",
+ "timestamp": "2026-02-25T20:49:29+00:00"
+ }
+]
diff --git a/guestbook/guestbook.php b/guestbook/guestbook.php
new file mode 100644
index 0000000..3e70b83
--- /dev/null
+++ b/guestbook/guestbook.php
@@ -0,0 +1,102 @@
+<?php
+// Enable error reporting while debugging
+ini_set('display_errors', 1);
+ini_set('display_startup_errors', 1);
+error_reporting(E_ALL);
+
+$dataFile = __DIR__ . '/guestbook.json';
+
+// Make sure the JSON file exists
+if (!file_exists($dataFile)) {
+ file_put_contents($dataFile, json_encode([]));
+}
+
+// Read existing entries safely
+$data = [];
+$fileContents = file_get_contents($dataFile);
+if ($fileContents !== false) {
+ $decoded = json_decode($fileContents, true);
+ if (is_array($decoded)) {
+ $data = $decoded;
+ }
+}
+
+// Handle form submission
+if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+
+ // Honeypot spam field
+ if (!empty($_POST['website'])) {
+ header("Location: guestbook.php");
+ exit;
+ }
+
+ $name = trim($_POST['name']);
+ $message = trim($_POST['message']);
+
+ if ($name && $message) {
+ $entry = [
+ "id" => time(),
+ "name" => substr($name, 0, 50),
+ "message" => substr($message, 0, 500),
+ "timestamp" => date("c")
+ ];
+
+ // Add new entry at the beginning
+ array_unshift($data, $entry);
+
+ // Save back to JSON file
+ if (file_put_contents($dataFile, json_encode($data, JSON_PRETTY_PRINT)) === false) {
+ echo "<p style='color:red'>Error: Could not save guestbook entry. Check file permissions.</p>";
+ }
+
+ // Redirect to avoid form resubmission
+ header("Location: guestbook");
+ exit;
+ }
+}
+
+// Entries to display
+$entries = $data;
+?>
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Guestbook</title>
+<link rel="stylesheet" href="../style.css">
+</head>
+<body>
+
+<canvas id="bg"></canvas>
+<div class="container">
+<h1>256phi Guestbook</h1>
+
+<form method="POST">
+ <input type="text" name="name" placeholder="Your name" required>
+ <textarea name="message" placeholder="Leave a message..." required></textarea>
+
+ <!-- Honeypot -->
+ <input type="text" name="website" style="display:none">
+
+ <button type="submit">Sign</button>
+</form>
+
+<hr>
+
+<?php foreach ($entries as $entry): ?>
+ <div class="entry">
+ <p><?= htmlspecialchars($entry['message']) ?></p>
+ <small>
+ — <?= htmlspecialchars($entry['name']) ?>
+ | <?= date("Y-m-d H:i", strtotime($entry['timestamp'])) ?>
+ </small>
+ </div>
+<?php endforeach; ?>
+
+<footer>
+ <p>© 256phi | 2026 | <a href="/home">Home</a></p
+</footer>
+</div>
+<script type="module" src="../main.js"></script>
+</body>
+</html>