This is the scenario:
- User clicks on Login
- Login.php runs (after it is done, redirect using header() )
- updater.php needs to run in background after Login.php
- User can use website after Login.php
updater.php takes about 5 minutes to finish running which is why it is separated from the login.php, which is also why it needs to run in the background after login.php in the meanwhile the user is free to use most parts of the website (the remainder after updater.php is done). I can't use include() as this will stall the login.php and won't redirect the user back until updater.php is finished.. I read about using Header() before include but it seems like sometimes, it does not run the full updater.php script (sometimes just 40% or 50% before it stops).
I guess I can use CURL to activate the script without affecting the loading time of login.php?
What is the best way to handle this? Please let me know if anything doesn't make sense.
Thank you.