PHP - displaying the status of the form processing

I have a form that performs 3 separate tasks when submitting. When the form is submitted, a lightbox / thick window appears to show the status.

The page sends itself a message, and as the task completes, it writes to the database containing the "status" field.

All of this works great.

I need the current state to be displayed / updated in the lightbox, but it just displays empty.

I read that you cannot send more than two requests at the same time, but I cannot even get 2 to work.

I use MooTools, but if you know a good way to do this using an iframe (or something) or another library like jQuery, I'm more than ready to switch.

I’ve been fighting this for some time, and I can’t get it to work for me. Is there a tutorial on how to do this?

+3
source share
2 answers

Instead of constantly maintaining an iframe for each task, why don't you query (with XMLHttpRequest) the status of each task in order?

+2
source

I tested using a standard text file to maintain status, and it works. Thanks shinkou, I would never have thought of that.

This may be due to a record locked in the database. If the process blocks write access and write access to the record until it ends, any write request will fail. So, you better check this out too.

0
source

Source: https://habr.com/ru/post/1731133/


All Articles