Files in '$currentPath'"; echo ""; } // 查看文件内容 if (isset($_GET['view'])) { $filePath = $_GET['path']; if (file_exists($filePath)) { echo "

Content of '$filePath'

"; echo "
" . htmlspecialchars(file_get_contents($filePath)) . "
"; } else { echo "File does not exist."; } } // 新建文件 if (isset($_POST['create'])) { $newFileName = $_POST['filename']; $filePath = $currentPath . DIRECTORY_SEPARATOR . $newFileName; if (file_put_contents($filePath, "") !== false) { echo "File '$newFileName' created successfully."; } else { echo "Failed to create file."; } } ?>

Create a new file