prepare($sql); $stmt->execute([$name, $client, $start_date]); } catch (PDOException $e) { // Proper error logging should be implemented // For now, redirect with a generic error header('Location: index.php?error=db'); exit; } header('Location: index.php?success=added'); exit; } else { // If not a POST request, redirect home header('Location: index.php'); exit; }