shelfimage Posted January 22, 2009 Report Share Posted January 22, 2009 FormA uses a PHP form mail script that sends an email to the recipient, sends and autoresponder to the user, and forwards the user to their confirmation page to review what they submitted. FormB is the other form which includes hidden id variables and strings using a POST method to connect to a https:// payment url. The hidden variables hold merchants account number and some other information specific to its function. It does not need to transmit data from FormA. So Form A and B are completely independent of each other. and ultimately we would like 1 button to trigger both forms. Right now user sees Form B's button on Form A's thankyou page. They fill out the form, go to the thank you page and press another button to go to the payment page. which works but adds 3 extra steps. I thought about a JS solution and maybe cURL to carry out the action of Form B I kind think the solution would be PHP based because if the form can sen out an autoresponder, error warnings to admins I think it could send out data to another predetermined URL maybe using a GET method. any thoughts? . Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted January 22, 2009 Report Share Posted January 22, 2009 (edited) I just goggled for about 20 minutes and all I could find were JS solutions. Apparently most were saying it's the only way. Here is one - there were a few others I came across as well. http://www.urbanpuddle.com/articles/2007/06/21/quick-tip-submit-two-forms-w-one-button Hope that helps Here is another (3rd post) http://www.phpbuilder.com/board/showthread.php?t=10351103 Edited January 22, 2009 by Eric Quote Link to comment Share on other sites More sharing options...
tpattison Posted January 22, 2009 Report Share Posted January 22, 2009 So, why are the forms separate? Is it not possible to combine both forms to submit to the same PHP script to be processed? What you've already mentioned - cURL and GET are the only ways I think you can do it. I have had similar problems with PayPal submissions, where I try to prevent people from changing the values in hidden fields, to be submitted directly to PayPal. Submitting from within a script would make the transaction secure. It seems like an obvious thing to do but it is exceedingly difficult to initiate a POST from within a PHP script. Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.