‘_xclick’,
‘business’ => ‘your_paypal_email@example.com’, // Replace with your PayPal email
‘item_name’ => ‘Event RSVP’,
‘amount’ => 100, // Amount in USD
‘currency_code’ => ‘USD’,
‘return’ => ‘success.html’, // Redirect to this page after successful payment
‘cancel_return’ => ‘cancel.html’, // Redirect to this page if the payment is canceled
‘notify_url’ => ‘notify.php’, // URL for IPN (Instant Payment Notification)
‘custom’ => $name . ‘|’ . $table . ‘|’ . $tableName . ‘|’ . $guests // Pass custom data
];

// Redirect to PayPal with the payment fields
header(‘Location: https://www.paypal.com/cgi-bin/webscr?’ . http_build_query($paypalFields));
exit();
} else {
// Redirect to an error page if the form is not submitted correctly
header(‘Location: error.html’);
exit();
}
?>