= $p['text'] ?>
IP: = $p['ip'] ?>
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 ================= */ ?>
Access denied
= $FLAG ?>
= $p['text'] ?>
IP: = $p['ip'] ?>