display something untill the php returns value
Hello
I want to know how can i display something untill php returns a value
example:
the server is gathering data from several sites Site A , Site B and Site C
while the server is gathering data from Site A i want it to display "gathering data" besides "Site A" and when it returns a value i want it to display "Finished" and the same thing for Site B and Site C.
i know this also will include javascript...
can someone give me alittle help in that i have tried searching and couldn't find any examples
Cheers
Adel
Re: display something untill the php returns value
The a look for the XMLHTTPRequest object in Javascript, it will enable you to make a request periodically and update the status. You don't need to use Javascript, you could use output buffers. But I would not recommend that because it will give you only limited control over the process.
Don't forget also the ignore_user_abort() function if you don't want the user to stop it by pressing the stop button in the browser.
Re: display something untill the php returns value
Thanks alot for Your reply
but Can you give me just a small code example?
like i want it to send a request every 1 second to File.php where this file will return an output then print that output on everyrequest untill the output is equal to Something then it stops sending requests...
Thanks Alot for your help in advance
Re: display something untill the php returns value
Check out the Ajax link in my signature.