prepare($sql); $stmt->bindParam(':name', $name, PDO::PARAM_STR); $stmt->bindParam(':email', $email, PDO::PARAM_STR); if ($stmt->execute()) { header('Location: volunteer_signup.php?status=success'); } else { header('Location: volunteer_signup.php?status=error'); } } catch (PDOException $e) { if ($e->errorInfo[1] == 1062) { // Duplicate entry header('Location: volunteer_signup.php?status=duplicate'); } else { header('Location: volunteer_signup.php?status=error'); } } } else { header('Location: volunteer_signup.php?status=invalid'); } exit(); } ?>