I have a php script that is suppose to run in the background of the server on a very very long loop. The problem is that a user has to call the script for it to begin. Is there a way to cut the users connection to the script? In other words:
Otherwise the user has to push the stop button or wait until the timer runs out. Right now the header does nothing until the loop ends-- and the loop doesn't end before the user times out.
header("Location: ./page.php"); //CUT THE USER'S CONNECTION HERE!
Or perhaps there is a way to run the script in another way, such as via the system() function? (Again, though, it would need to be called through a php script and redirect the user rather then having them stick around until they time out.)