Forum Moderators: coopster
Take the url out of the form action and add it into another hidden field. Then dump all of those hidden fields into the other form. When you do your redirect to paypal you will have to build the url from the hidden fields and then redirect the visitor.
Just make sure that you don't have any repeated field names or it could make a bit of a mess.
The first method is simple, but it depends on PayPal's cgi interface being written in a generic manner to accept bot POST and GET type form submissions. (Not an outrageous assumption, but you won't know until you try). On the HTML page, you set the <form>'s ACTION element to point to your php code. The php code performs said local magic, and then instead of emitting the HTTP "Content-Type: text/html" header followed by some <HTML>, you instead emit a "Location:" header with a URL pointing to the PayPal cgi code, including a query string consisting of all of the field name and value pairs, as in:
Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&busines=YourBizName&item_name=YourItem&item_number=01&amount=.01\n\n
(there are more parameters required, but you get the idea).
If PayPal won't handle this access method, the only alternative I see is, again perform your magic and then have your php script emit an <HTML> page containing only an invisible <FORM> whose ACTION is pointed to PayPal as normal, and populated with the appropriate <item type="hidden" value="whatever"> elements, and then set the BODY tag to <body onload="document.forms[0].submit();">. Its clumsy, very brute-force-ish, and relies on the user having JavaScript enabled, but it should get the job done.
[edited by: jatar_k at 3:46 pm (utc) on April 17, 2003]
[edit reason] sidescroll [/edit]
I was able to just redirect using the http given by Paypal for email submission. Since I was sending everything through Sendmail, it was no bother that the hidden fields weren't used in the Paypal submission. I could even specify the redirect back from Paypal in the http. Can't believe I spent two days on figuring that one out.
Thanks again for the suggestions!