I have a form and a custom PayPal button, but how do I pass the value/price variable to PayPal?
The previous code did not work for me. After much headache I finally figured out you have to go into PayPal and on step 2 of creating the button code make sure you click the unhosted button, and then copy the unencrypted button code, which will give you something like this (I blanked out my business value for security):
This code creates a button where the user can input the amount, which by default starts at 16.99, but you could just as easily replace that with a PHP variable.