0

I have a page orderbelow.php which has a form on it with one button "Order Now".

The form is submitted to send-order.php which sends an email to the website owner. The script on send-order.php also directs the user to a new page completeyourorder.php.

There is a form on completeyourorder.php with a button that has the action of sending the user to paypal to complete the payment.

Is it possible to have one button on the first form orderbelow.php that sends the email to the owner, and sends the user to paypal?

This will remove one step in the current process.

Thanks

user1098813
  • 41
  • 1
  • 6
  • 1
    You can use ajax for it. – vaso123 Aug 02 '16 at 11:35
  • in the send-order.php, first send email to the website owner, if email is done, then redirects to the page completeyourorder.php. why you complex the action. – Jees K Denny Aug 02 '16 at 11:38
  • The user is required to click another button on completeyourorder.php in order top go to paypal. I want the user to go straight from orderbelow.php to paypal. – user1098813 Aug 02 '16 at 12:07

1 Answers1

0

You can either send a email to the owner without refreshing the page: this should be done with AJAX (fancy name for simple Javascript requests sending ^^).

You can also add a location header in your first PHP script to automatically redirect to the second PHP script: this should be done with the function header in PHP.

hmicn
  • 114
  • 9