Jump to content

I was hoping to find a sticky on this; can 1 button sumbit 2 forms?


shelfimage

Recommended Posts

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?

.

Link to comment
Share on other sites

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 by Eric
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...