How are you populating the custom
value? When you define your @MyUserID
you can INSERT
the value into your database at that time.
Why do you need it to be before the user is redirected to PayPal? That may turn out to be a problem if the user doesn't complete the payment. You should wait until after the transaction has occurred. Using IPN you'll get a post back to a notification script and you can grab the custom
value and whatever else you need and toss it into a database.