IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
  • 1 reply
  • Latest Post - ‏2014-09-20T11:40:56Z by jitupkp
1 Post

Pinned topic How to use AJAX for getting information from multiple servers?

‏2012-02-27T11:37:08Z |
I have created a simple php script that searches through several whois servers (.com, .net, .info etc.) for the availability of a domain name.
Additionally, I made the script look also for different other domain names by adding prefixes and suffixes to the search term. (E.g. if you look for the domain name boss.com, the script also looks for superboss.com and bossmatic.com).

I have a list of 20 prefixes and 20 suffixes that the script is looking for at the moment, summing up more than 120 requests to the whois servers.

My problem is that the browser waits for all the script to finish until displaying the full result. This might take a while (depending on the whois server charge) and it's not very nice for the user.

What I would like, is to show the results one by one as received from the whois servers. For this I have tried to use flush() and ob_flush() PHP functions in different manners, but with no result.

Recently I learned that only AJAX would solve my issue. I have read some tutorials, but I have no idea how to apply it in my special case.

Could anyone here give me some hints?

Thank you.