prepare("INSERT INTO papers (title, authors, publication, year, notes) VALUES (?, ?, ?, ?, ?)"); $stmt->execute([$title, $authors, $publication, $year, $notes]); header("Location: /?toast=" . urlencode('Paper added successfully!')); exit; } catch (PDOException $e) { // In a real app, you'd log this error. header("Location: /add_paper.php?toast=" . urlencode('Error adding paper.')); exit; } } } include 'partials/header.php'; ?>