Question

This is the thing, i am preparing a webpage and i need that PHP holds a condition, if the condition is true, it execute some program with the function exec(), after that, (as it is automated) the webpage should refresh itself to keep looking the condition, if the condition is false, it should refresh after two seconds of waiting.

I was doing something with header("refresh:2;url=_url_here"); but its useless if the function exec() lasts longer than two seconds...

Thank you in advance for your help.

Was it helpful?

Solution

something like exec ("command > /dev/null 2>&1 & echo $!", $data); once that is done, check for pid id, if id exists, then the rest is homework. but best way is have cron update a file and you can check that file for any updates.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top