Dosya oluşturuldu: $newFile"; header("Location: ?file=".urlencode($newPath)); exit; } else { echo "
Hata: Bu isimde bir dosya zaten var!
"; } } else { echo "
Geçersiz dizin!
"; } } /* --- DOSYA KAYDETME --- */ if (isset($_POST['save']) && isset($_POST['filepath'])) { $filePath = $_POST['filepath']; if (strpos(realpath($filePath), realpath(__DIR__)) === 0 && is_writable($filePath)) { file_put_contents($filePath, $_POST['filecontent']); echo "
Dosya başarıyla kaydedildi!
"; } else { echo "
Hata: Bu dosya düzenlenemez!
"; } } /* --- CHMOD 755 --- */ if (isset($_GET['chmod'])) { $target = $_GET['chmod']; if (file_exists($target) && strpos(realpath($target), realpath(__DIR__)) === 0) { if (chmod($target, 0755)) { echo "
İzinler 755 olarak ayarlandı: ".htmlspecialchars(basename($target))."
"; } else { echo "
Hata: İzinler değiştirilemedi.
"; } } else { echo "
Geçersiz dosya!
"; } } /* --- DOSYA DÜZENLEME --- */ if (isset($_GET['file'])) { $target = $_GET['file']; if (is_file($target)) { echo "

Dosya Düzenleme: ".basename($target)."

"; echo '
'; echo '
'; echo ''; echo ''; echo ' Geri Dön'; echo '
'; exit; } $path = rtrim($target, '/').'/'; } else { $path = $root.'/'; } /* --- DİZİN LİSTELEME --- */ echo "

PHP Dosya Tarayıcı + Düzenleyici + Oluşturucu + CHMOD

"; echo($root.'
'); echo($path.'
'); echo '..
'; /* --- DOSYA OLUŞTURMA FORMU --- */ echo '
'; echo ''; echo ''; echo ''; echo '

'; /* --- DOSYA VE KLASÖRLERİ LİSTELE --- */ $p = $path.'*'; foreach (glob($p) as $file) { if (is_file($file)) { echo ''.basename($file).''; echo ' — [chmod 755]'; echo '
'; } else { echo ''.basename($file).'
'; } } echo('
'); ?>