prepare("DELETE FROM files WHERE filename = ?"); $stmt->execute([$filename]); header("Location: index.php?message=File+deleted+successfully&type=success"); } catch (PDOException $e) { header("Location: index.php?message=File+deleted+but+database+error:+" . $e->getMessage() . "&type=danger"); } } else { header("Location: index.php?message=Error+deleting+file&type=danger"); } } else { header("Location: index.php?message=File+not+found+or+invalid&type=danger"); } } else { header("Location: index.php"); } ?>