if (isset($_POST['filename'])) {
$file = basename($_POST['filename']); // secure: removes 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>";
}
}




<button type="submit">🗑️ Delete</button>