Hi there. I would love some advice on the correct way to make a double post.
Basically, I have a php form that receives customers details such as name, address, phone number etc. When the user confirms and submits the form for an order via a POST , I insert the users details into a database on the next page, setting orderComplete=0, and then rebuild the form on the same page with php and hidden fields to post alternative specific values to a 3rd party such as Paypal etc with Javascript i.e.
echo '<form method="post" action="thirdpartypage.php" id="sendtoparty" name="sendtoparty">';
echo '<input type="hidden" value="all other values" />
echo '<script>document.sendtoparty.submit();</script>';
This works fine in that as far as the customer is concerned, they basically just get redirected as should but there has to be a better way / standard practice for this.
e.g. if Javascript was disabled, the redirect would not happen etc
What is the best way / practice for coding a page like this where you process POST variables, then make another POST to a differnt URL in the most seamless way