I honestly have no idea if this question has been asked before, or something similar like it. It’s hard to search on such a thing.
So, here goes. I would like my webpage to run a program (PHP would be the correct choice here, yes?) hosted on the server, and then use the output of that program to print to a webpage. However, the program doesn’t print its output all at once, thus, when I’ve tried this before, it waits until the program exits successfully before printing output, rather than printing it as it is received. (Which makes sense)
How would one go about printing output to the webpage as each new result is returned? That is, after displaying the webpage, have entries be added to a div as the program outputs lines of text.
Ajax? Javascript? I’m just looking for what the be the correct way to go about this, not code.
Personally, I would do this with three files:
My workflow would be as follows: