Files in '$currentPath'"; 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."; } } ?>