PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a php script that can take 10-60 min to complete. I would like to be able to see the progress of this script while its running. I tried adding echo/print but these echo only appear on screen when the script is complete so I cant track the progress. I also tried flushing, but it doesnt work...
What could I do to track the progress of my PHP script while its running?
Main page uses AJAX to initiate PHP script;
PHP script periodically writes progress to text file;
Main page periodically reads the text file with AJAX and displays it;
Don't know. You might try to see if AJAX will progressively display the response. But, instead of showing it when readyState is 4, use setInterval() to display the responseText every few seconds.