From cb2fee3c38e72928d5e17eb7a328ded2407ae2b6 Mon Sep 17 00:00:00 2001 From: EsgiPriv Date: Wed, 7 Jan 2026 22:50:39 +0000 Subject: [PATCH] Add index.php --- index.php | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..a44b06c --- /dev/null +++ b/index.php @@ -0,0 +1,158 @@ + 2 * 1024 * 1024) { + die("Image too large"); + } + + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mime = finfo_file($finfo, $_FILES['image']['tmp_name']); + finfo_close($finfo); + + if (!in_array($mime, ['image/png', 'image/jpeg'])) { + die("Only PNG or JPEG allowed"); + } + + $ext = pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION); + $imageName = uniqid() . "." . $ext; + move_uploaded_file($_FILES['image']['tmp_name'], $UPLOAD_DIR . $imageName); + } + + $posts = json_decode(file_get_contents($POSTS_FILE), true); + $posts[] = [ + "text" => htmlspecialchars($_POST['comment']), + "image" => $imageName, + "ip" => $ip, + "time" => time() + ]; + + file_put_contents($POSTS_FILE, json_encode($posts)); + $rates[$ip] = time(); + file_put_contents($RATE_FILE, json_encode($rates)); + + header("Location: index.php"); + exit; +} + +/* ================= HTML ================= */ +?> + + + + + +Mini Forum DevWeb + + + + + + + +
+ + + +

Login admin

+
+ User:
+ Pass:
+ +
+ + + + +

Access denied

+ +

Flag DevWeb

+

+ + + + +

Post a comment

+
+
+
+ +
+ +

Posts

+ + $b['time'] - $a['time']); + +foreach ($posts as $p): +?> +
+

+

IP:

+ + + +
+ + + + + +