form post and http response code
Posted: Wed Feb 21, 2007 5:21 pm
Hi all,
Beeing a newbie php programmer, I need some help here.
The scenario
I have a form to gather some user input which is then sent to a remote url via post method. The remote url then returns a http response code indicating either error or all is ok and a file to donwload.
I have no access to the server on the remote end. All I know are the respective http response codes.
What I need
I would like to send the info via post, wait for the response code, and then act on the response code. If there is an error, redisplay the form in order to correct the error. If all is ok, then display a summary of the info and the user will then download the file.
How could I go about doing this. I already have the form and validation is ok, it's just that when I send the info and get an error message, I have to press the back button of the browser.
Any help or pointers in the right direction would be greatly appreciated.
Cheers,
P.
Beeing a newbie php programmer, I need some help here.
The scenario
I have a form to gather some user input which is then sent to a remote url via post method. The remote url then returns a http response code indicating either error or all is ok and a file to donwload.
I have no access to the server on the remote end. All I know are the respective http response codes.
What I need
I would like to send the info via post, wait for the response code, and then act on the response code. If there is an error, redisplay the form in order to correct the error. If all is ok, then display a summary of the info and the user will then download the file.
How could I go about doing this. I already have the form and validation is ok, it's just that when I send the info and get an error message, I have to press the back button of the browser.
Any help or pointers in the right direction would be greatly appreciated.
Cheers,
P.