From f6d1edb5e928b260afc8363b184123e017783285 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 22 Mar 2026 22:36:36 +0100 Subject: Initial commit of the original website --- guestbook/guestbook.php | 102 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 guestbook/guestbook.php (limited to 'guestbook/guestbook.php') 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 @@ + 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 "

Error: Could not save guestbook entry. Check file permissions.

"; + } + + // Redirect to avoid form resubmission + header("Location: guestbook"); + exit; + } +} + +// Entries to display +$entries = $data; +?> + + + + +Guestbook + + + + + +
+

256phi Guestbook

+ +
+ + + + + + + +
+ +
+ + +
+

+ + — + | + +
+ + +
+

© 256phi | 2026 | Home

+
+ + + -- cgit v1.2.3