shamwowy Posted June 11, 2011 Share Posted June 11, 2011 Hi all, hoping someone can help. I have a very small shopping cart app that collects customer information (name, address, cc#, etc.) all on one page. My problem is that I want to capture the name and contact information in my own database and at the same time send the credit card information all to the payment processing company. So it kinda looks like this: Form page collects- Name, Address, Phone, Email, Credit Card Number, Expiration Date Action page 1 - insert into my database (Name, Address, Phone, Email) Action page 2 - post method to credit card authority (Name, Address, Phone, Email, Credit Card Number, Expiration Date) In the past I've always had contact info on a separate page, so I could save to the db before I "checkout", in this case it's all one form, with only one submit button. In theory, the processing company gives me a receipt page, so I suppose I could have them pass me back all the form field variables and do my insert after the transaction, but I'd rather do it in the order above. Any help would be most appreciated Quote Link to comment https://forums.phpfreaks.com/topic/239053-single-form-post-method-to-multiple-action-pages/ Share on other sites More sharing options...
spiderwell Posted June 11, 2011 Share Posted June 11, 2011 you could process the info you require and save to the db, then use php to echo out a form and place the CC info into that form, using the php to then echo out a javascript command to submit form to the CC company when page is loaded. there might well be a way to post to a url via php directly but i don't know it if it does exist. lol Quote Link to comment https://forums.phpfreaks.com/topic/239053-single-form-post-method-to-multiple-action-pages/#findComment-1228271 Share on other sites More sharing options...
jcbones Posted June 11, 2011 Share Posted June 11, 2011 You could use cURL to pass POST to a url directly. Quote Link to comment https://forums.phpfreaks.com/topic/239053-single-form-post-method-to-multiple-action-pages/#findComment-1228310 Share on other sites More sharing options...
shamwowy Posted June 11, 2011 Author Share Posted June 11, 2011 Thanks guys/girls. I'll try submitting the form to itself, process the db capture, then rewrite the form as suggested above and send it off with cURL. Appreciate your help Quote Link to comment https://forums.phpfreaks.com/topic/239053-single-form-post-method-to-multiple-action-pages/#findComment-1228477 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.