All you need to do is have your script output the form with the fields filled out properly, like
<body onload="document.myform.submit()">
<form action="the paypal url" name="myform" method="post">
<input type="hidden" name="some paypal form key" value="the correspond
+ing value">
<input type="submit" value="click here to continue">
If the user has JavaScript enabled, they probably won't notice the redirect.
Edit: It seems people are misunderstanding what I wrote. OP's problem, as I understood it, was that their script needs to add items to their user's PayPal cart. PayPal has a way of doing this, which involves putting a form on your webpage for the user to click on. Perhaps OP needs to look up the product ID or something, so just using the default form won't work. Here's what PayPal suggests you put on your page. Those hidden fields are already filled out. The only thing the user would see is the "Add to cart" button. My suggestion was to have OP's script fill out those fields as they should be anyways, and then to "click" the button for the user, to streamline the buying process.
- Thomas
"Excuse me for butting in, but I'm interrupt-driven..."
|