I have two different servers, and I need to send post data from one server to another. But there are some issues that I'll describe below. First, let me describe them:
- First server's using Apache + PHP, running on Linux.
- Second server's using IIS, running on Windows. PHP is installed.
Now, here's what I'm trying to do:
- On my first server, user fills a form and submits it to a file in the same server.
- In that file, I'll process the data filled by the user and redirect my user to a page on my second server. This redirection has to go with the result of my data processing as a POST request.
- Still on my seconds server, my user will finish entering his credit card information. Then, I'll process the payment.
- After my payment's done processing (on my IIS server), I redirect my user back to another file in my first server, with more POST data (results of payment processing).
I don't really know, though, how to redirect my user without 'echoing' a form and submitting it again.
I've done a lot of reading on the subject, and I managed to make my apache send post data using cURL or even using stream_context_create
and stream_get_contents
, and retrieve the result. What I want to do, though, is redirect my user along with the post data, instead of dispatching a request and displaying the result.
This is not a duplicate of this question, for my files are not in the same server, as q0987's were, making it impossible to store my data in the user's session.
I also realize I can't use header
functions to make requests, as the header
functions only creates response headers.
I don't have enough privileges to install any libraries on the IIS server (like cURL/libcurl). I can't process the payment on my first server, seeing only the IIS is allowed to access the VISAnet libraries. I also can't put it all on my IIS.
I'm trying to accomplish that with PHP, but I don't even know if what I'm trying to do is possible.
I don't want to write down and submit forms, as it messes up my user's history (and the back button).