if (isset($_POST['filename'])) {
$file = basename($_POST['filename']); // prevent path traversal
if (file_exists($file)) {
unlink($file);
echo "<p style='color:green;'>✅ Deleted: <strong>$file</strong></p>";
} else {
echo "<p style='color:red;'>❌ File not found: <strong>$file</strong></p>";
}
}