I'm having trouble integrating the paypal form into my order page.
My order page currently already has a form that the user fills out, and a submit button:
<form id="order-form" form name="orderform" method="post" action="send_order_email.php">
This send_order_email.php goes through and validates whether the form is valid or not, if not it redirects to a sorry page if valid I would like it to redirect to paypal with the below:
<form target=paypal action="https://www.paypal.com/cgi-bin/webscr" method=post>
<input type=image src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif " border=0 name=submit alt="Make payments with PayPal - it's fast, free and secure!">
<input type=hidden name=add value=1>
<input type=hidden name=cmd value=_cart>
<input type=hidden name=business value=" info@info.co.uk">
<input type=hidden name=item_name value="item">
</form>
At the moment I can only get either the form to send by making the action="send_order_email.php"
or I can make the form redirect to paypal by making the form target=paypal action="https://www.paypal.com/cgi-bin/webscr"
, this however doesn't go through any of the validation and sends no emails.
How can I get the form to do both actions - Verify one form and then redirect using paypals submit form all through one submit button?
Any help would be really appreciated.
Thanks!