Php long running script to dynamically update html


This code is a work in progress and should never be used in a production environment without extensive testing!

First, the page that is loaded into the browser, it uses jQuery to receive status updates from ‘getstatus.php’ script




Update Inventory
   

	

Long Running Script

This is the long running script simulator


\n");
      sleep(1);
      $i++;
    }
	
fclose($fh);

?>

And getstatus.php, the script that returns data to be appended to div


Try it here (buggy)

,

2 responses to “Php long running script to dynamically update html”

  1. I like the approach..but I don’t know why it won’t create the file until the loop finishes, even if I open and close the file inside the loop

    Thanks for sharing!

Leave a Reply to Yes Cancel reply

Your email address will not be published.