0

I searched a lot of places, but couldn't find solution.

What I want to do is:

  1. submit a form on PHP server to another server, the request is to search some results back;
  2. The search will take several minutes, so the other server will first return a progress html page, the will page will call back to ping the other server when the final result will be returned;
  3. Get the final result page

The function is easy if form is submitted from browser. After viewing progress page, the final search result page will be returned and shown in browser.

But I don't want to show those on my client. I want to process that on my server, process data and show something else on my client.

Thanks a lot!!

Hyi
  • 1

1 Answers1

0

You'll need some way of tracking whether a form has been processed or not - I recommend using a database entry. So here are the basics of your algorithm:

  1. When the user submits the form to your client, you add a new record to the DB.
  2. The required data from this form is sent to the other server.
  3. Any client who accesses your page will be shown the 'Waiting' layout (because the complete DB column is set to '0')
  4. When the processing is complete, the other server hits a listener script on your server, providing it the form ID. You then update the complete column in the DB to '1'
  5. When the user visits the page now, they see its been completed.

I'm not going to write the code for you, but this functional overview should set you on your way.

hohner
  • 11,498
  • 8
  • 49
  • 84
  • Thanks hohner! Do you have suggestions how to implement the listener script on server? – Hyi Feb 17 '13 at 01:08