Dosya oluşturuldu: $newFile"; // otomatik olarak düzenleme ekranına yönlendirme 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!
"; } } /* --- 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

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

'; $p = $path.'*'; foreach (glob($p) as $file) { echo ''.basename($file).'
'; } echo('
'); ?>