I have a PHP file that takes a while to run, it has several parts to it, Is there a way to send a command back to javascript after part of the PHP file has been completed?
5
-
Have you looked into AJAX at all?BenM– BenM2013-02-07 09:57:23 +00:00Commented Feb 7, 2013 at 9:57
-
Yeah, I used AJAX to have a loading gif, but I want incremental updates to my text. So the person knows whats happening.William L.– William L.2013-02-07 09:58:41 +00:00Commented Feb 7, 2013 at 9:58
-
By the sounds of what you want to achieve (incremental updating), you'll have to use a series of AJAX requests.BenM– BenM2013-02-07 10:00:26 +00:00Commented Feb 7, 2013 at 10:00
-
Try working with output buffering (ob). This post might be helpful stackoverflow.com/questions/6313159/…Mike– Mike2013-02-07 10:00:36 +00:00Commented Feb 7, 2013 at 10:00
-
You can call some page that will start the long running script and returns a filename where that scripts output will be, the next ajax call would be to that filename as your long running script appends to that file. When done it puts "I am done" or something at the last line so your JavaScript knows not to make any more requests and has the full content. Once every so often delete all the files created in this way.HMR– HMR2013-02-07 10:09:06 +00:00Commented Feb 7, 2013 at 10:09
Add a comment
|