| 
	
 | 
 Posted by axlq on 06/17/66 11:56 
How do I create a form that two submit buttons, where each one 
submits the form input data to a different server? 
 
Consider this situation:  I have a form where users can check various 
options to subscribe to a service, and each option costs a certain 
amount.  When the form is submitted, my php script totals up the 
options.  Fine. 
 
The form has 2 submit buttons: "print invoice" and "pay by credit 
card." 
 
The "print invoice" button is for those businesses who can't pay by 
credit card but must mail us a check instead; they print an invoice 
for their accounts payable department.  The php script generates the 
invoice based on the form inputs. Easy, no problem. 
 
The problem is "pay by credit card."  The total cost from submitted 
input fields must be POSTed to a different server: our credit card 
processor. 
 
This isn't a problem if the credit card processor accepts the 
form input data as a GET string in the URL; all I'd do is 
header("Location: $url"); to redirect the user to the credit card 
processor page which handles the payment.  The problem is I need 
to do this by POSTing the form input data, while at the same time 
retain the ability to generate invoices from MY server using the 
same form. 
 
I can't think of an elegant way to do this except to have two 
different payment pages each with their own form. Or maybe force 
everybody to generate an invoice as the first step, and after that 
point they can choose to pay it by credit card. 
 
-A
 
  
Navigation:
[Reply to this message] 
 |