📁 /
⬆️ Up
| Path: /home/uby7irpj/public_html/filemanager.aiphp.web.id/
Nama
Size
Aksi
📁
..
-
Delete
📁
.well-known
-
Delete
📁
cgi-bin
-
Delete
📄 error_log
0.2 KB
View
Edit
Delete
📄 index.php
4.1 KB
View
Edit
Delete
Upload File
Upload
Buat File Baru
Buat
Buat Folder
Buat
Edit: index.php
<?php // FILE MANAGER TANPA PASSWORD - TAMPILAN TETAP SAMA - JANGAN DI HIDE define('BASE_DIR', __DIR__); // PATH $current = isset($_GET['d'])? $_GET['d'] : ''; $current_path = realpath(BASE_DIR. '/'. $current); if(!$current_path || strpos($current_path, BASE_DIR)!== 0) $current_path = BASE_DIR; $current = str_replace(BASE_DIR, '', $current_path); $current = ltrim($current, '/'); $msg = ''; if(isset($_POST['newfile'])){ file_put_contents($current_path.'/'.$_POST['newfile'], $_POST['content']??''); $msg="File dibuat!"; } if(isset($_POST['newfolder'])){ @mkdir($current_path.'/'.$_POST['newfolder']); $msg="Folder dibuat!"; } if(isset($_GET['delete'])){ $t = $current_path.'/'.$_GET['delete']; is_dir($t)?@rmdir($t):@unlink($t); $msg="Dihapus!"; } if(isset($_POST['save_edit'])){ file_put_contents($current_path.'/'.$_POST['edit_file'], $_POST['edit_content']); $msg="Disimpan!"; } if(isset($_FILES['upload'])){ foreach($_FILES['upload']['tmp_name'] as $k=>$tmp){ move_uploaded_file($tmp, $current_path.'/'.$_FILES['upload']['name'][$k]); } $msg="Upload berhasil!"; } $files = scandir($current_path); ?> <!DOCTYPE html> <html><head><meta charset="utf-8"><title>File Manager - aiku</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body{font-family:sans-serif;background:#f8f9fa;padding:20px;margin:0} a{text-decoration:none} .top{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap} table{width:100%;background:#fff;border-collapse:collapse;margin-top:15px} th,td{padding:10px;border:1px solid #eee;text-align:left} .btn{padding:5px 10px;background:#eee;border-radius:5px;margin-right:5px;font-size:12px;display:inline-block} .btn-del{background:#ffdddd} .btn-edit{background:#ddf3ff} /* JANGAN DI HIDE - SELALU TAMPIL */ #filemanager{ display:block !important; visibility:visible !important; opacity:1 !important; } </style> </head><body> <div class="top"><h2>📁 /<?= $current ?></h2><span style="color:green"><?= $msg ?></span></div> <a href="?d=<?= urlencode(dirname($current))?>">⬆️ Up</a> | Path: <?= BASE_DIR ?>/<?= $current ?> <!-- FILEMANAGER UTAMA - JANGAN DI HIDE --> <div id="filemanager"> <table><tr><th>Nama</th><th>Size</th><th>Aksi</th></tr> <?php foreach($files as $f){ if($f=='.') continue; $fp=$current_path.'/'.$f; $isDir=is_dir($fp);?> <tr><td><?= $isDir?'📁':'📄'?> <?php if($isDir){?><a href="?d=<?= urlencode($current.'/'.$f)?>"><?= $f?></a><?php }else{ echo $f; }?></td> <td><?= $isDir?'-': round(filesize($fp)/1024,1).' KB'?></td> <td> <?php if(!$isDir){?> <a class="btn" href="?d=<?= urlencode($current)?>&view=<?= urlencode($f)?>">View</a> <a class="btn btn-edit" href="?d=<?= urlencode($current)?>&edit=<?= urlencode($f)?>">Edit</a> <?php }?> <a class="btn btn-del" href="?d=<?= urlencode($current)?>&delete=<?= urlencode($f)?>" onclick="return confirm('Hapus <?= $f?>?')">Delete</a> </td></tr> <?php }?> </table> <div style="display:flex;gap:20px;margin-top:20px;flex-wrap:wrap"> <form method="POST" enctype="multipart/form-data"><h4>Upload File</h4><input type="file" name="upload[]" multiple required><button>Upload</button></form> <form method="POST"><h4>Buat File Baru</h4><input name="newfile" placeholder="nama.php" required><br><textarea name="content" placeholder="isi file..."></textarea><br><button>Buat</button></form> <form method="POST"><h4>Buat Folder</h4><input name="newfolder" placeholder="nama folder" required><button>Buat</button></form> </div> </div> <!-- END FILEMANAGER --> <?php if(isset($_GET['view'])){ $vf = $current_path.'/'.$_GET['view']; echo "<h3>View: ".$_GET['view']."</h3><pre style=background:#fff;padding:15px;overflow:auto;border:1px solid #ddd>".htmlspecialchars(file_get_contents($vf))."</pre>"; }?> <?php if(isset($_GET['edit'])){ $ef = $current_path.'/'.$_GET['edit'];?> <h3>Edit: <?= $_GET['edit']?></h3> <form method="POST"><input type="hidden" name="edit_file" value="<?= htmlspecialchars($_GET['edit'])?>"><textarea name="edit_content" style="width:100%;height:300px"><?= htmlspecialchars(file_get_contents($ef))?></textarea><br><button name="save_edit">Simpan</button></form> <?php }?> </body></html>
Simpan