I have an app which needs to show an alert at a certain time and I need to run some PHP in the background.
echo "My content";
// Run below code asynchronously without interrupting the client's page from loading
sleep(60);
header("location: alert.php");
Instead of the client's browser waiting for all the PHP to finish, I want it to load and then to display the alert after 60 seconds. I also cannot use JavaScript for this for security reasons.
setTimeout(myRedirectFunc, 60000)