on the confirm page, change line 24:
if (isset($_POST["Submit_order"])) {
to:
if (isset($_POST["Checkout"])) {
Submit_order is the name of the submit button on the confirm page, Checkout is the name of the button on the checkout page, you want the server validations to occur when the checkout page submits to the confirm page, so the trigger must use the submit button freom the checkout page, not the submit button from the confirm page.