Jump to content

click a button with PHP


Afallach

Recommended Posts

There's plenty of instruction on forums about clicking a button to run a script, but not so much about running a script to click a button.

 

How do you use a single script to post data from a form and then run a PayPal script, passing along the values that PayPal provides with its buttons to open the appropriate payment processing page?

 

I have a registration form for an event. My processing script contains a confirmation for the user, which displays PayPal's button for the user to click to proceed to payment. How do I take the user directly on to PayPal without a second click?

 

Here's the PP button code:

 

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_s-xclick">

<input type="hidden" name="hosted_button_id" value="GHDB7HUPTKJBG">

X <input type="image" src="images/Purchase_btn.gif" border="0" name="submit" >

X <img alt="" border="0" src="pixel.gif" width="1" height="1">

</form>

 

(I assume I can eliminate the lines I marked with an "X".)

 

As i understand it, I need to send the pairs "cmd / _s-xclick" and "hosted_button_id / GHDB7HUPTKJGB" to the PayPal script, and I don't have a clue how.

Edited by Afallach
Link to comment
Share on other sites

So what you're doing to do is.... the user enters info into a form and hits submit(first click), the form gets processed and then the PayPal button appears for the user, but instead of the user clicking on the BuyNow button(this would be second click, what you don't want I believe), you want the user to automatically go to the PayPal page to make purchase as if they already clicked on the BuyNow button?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...