Afallach Posted April 26, 2014 Share Posted April 26, 2014 (edited) 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 April 26, 2014 by Afallach Link to comment Share on other sites More sharing options...
Don E Posted April 26, 2014 Share Posted April 26, 2014 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 More sharing options...
Ingolme Posted April 27, 2014 Share Posted April 27, 2014 You can use cURL to send HTTP requests to other websites with PHP. You can look at the functions and check the examples provided in the manual. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now