AJAX (prototype/php) getting partial status updates during script execution

前端 未结 1 1922
有刺的猬
有刺的猬 2021-01-13 16:03

I have a process I want to run in the background of a page. The process will take a while to run, lets say a few minutes.

I have it set up so that from the page I ca

相关标签:
1条回答
  • 2021-01-13 16:45

    With just PHP you'll pretty much end up doing polling. You'll need to spawn your long-running process in the background, and for example write to a database of file what it's progress is.

    The browser can then call a different php script every x seconds, which reports back with this status.

    Polling sucks though, but that's what you're stuck with, with PHP.

    0 讨论(0)
提交回复
热议问题