I have a HTML form which does a POST submit to a FedEx PHP script that takes 20-25 seconds to complete execution.
My Intention : Upon hitting submit button, the screen immediately refreshes to the new PHP generated page, showing a message "Form data submitted. Proceesing may take up to 30 seconds". Followed by a few status update message. And eventually a "Success" message upon completion of the FedEx PHP script. All sequentially outputted as the script execution progress.
My Problem : Upon hitting submit button, the screen remains at the form page, and the screen does not refresh until the end of the FedEx PHP script execution. So that leaves a long period of silence and user not knowing the submission status.
What I have tried so far : ob_flush() flush() . I thought initially it was an output buffering problem . But when I execute FedEx PHP script by doing a repost (right click->refresh). the status message is flushed sequentially using ob_flush() flush() . It's only when I do a submission form a HTML form , that nothing gets outputted until the end of the PHP script where everything gets flushed at once.
Please help! Thank you in advance.
Gary Cho