I have a blank application in which some processing is done against the database. As this does take quite some time, I have inserted both HTML (with the “?>” and “<?PHP” tags before and after the HML respectively) for the OnExecute event. After the HTML come the PHP code that interacts with the database. Included in this code, are a number of echo statements giving regular progress information. My intent was to let the user know what was going on as well as giving regular status updates.
Unfortunately, the above does not work. The HTML and echo statements give the expected output, but they are only displayed after the PHP code in the OnExecute event has run to the end. Thus, the user will see only a blank page for a long time, and then suddenly at the end, my HTML as well as the accumulated status messages are displayed in one go.
Now, I have used some time trying to find a solution in PHP and the answer mostly given, is to use the flush() and ob_flush() functions. However, they seem to have no effect whatsoever.
Any suggestions on how to get an update to the screen while the PHP code executes would be appreciated.