Check input after form submission, then continue with POST
Posted: Tue Jul 26, 2011 12:17 pm
Hi,
I am hoping to create a form which collects users details, checks if the details are valid and then posts to a third party payment system. The issue I am having is that if the form submits back to the same page in order to do the validation, then I have no way of sending a redirect with the POST headers still intact.
My way of getting around this at present is to have the form (on formPage.php) submit back to itself, and if the details are valid then to redirect to another page on my site (confirmDetails.php). On this second page the user must check their details and click on a confirm button which then does the POST to the third party.
Is there any way to have the form post back to the same page in order to validate the users details, and then to programmatically post to the third party? My understanding is that modifying the header location will not work as the post variables with not remain intact. I have seen a number of forum posts where it is suggested that javascript be used to automatically submit the form, but I would like to avoid this if possible, in case the user has javascript disabled.
Thanks for your help
I am hoping to create a form which collects users details, checks if the details are valid and then posts to a third party payment system. The issue I am having is that if the form submits back to the same page in order to do the validation, then I have no way of sending a redirect with the POST headers still intact.
My way of getting around this at present is to have the form (on formPage.php) submit back to itself, and if the details are valid then to redirect to another page on my site (confirmDetails.php). On this second page the user must check their details and click on a confirm button which then does the POST to the third party.
Is there any way to have the form post back to the same page in order to validate the users details, and then to programmatically post to the third party? My understanding is that modifying the header location will not work as the post variables with not remain intact. I have seen a number of forum posts where it is suggested that javascript be used to automatically submit the form, but I would like to avoid this if possible, in case the user has javascript disabled.
Thanks for your help