skij
asked on
PHP: Redirection Header Before Background Processes Complete
Using PHP, how can I send a redirect header first, then do something in the background after the browser has already be redirected?
In the example below, even though the redirection is called for immediately, there is a 30 second pause before it occurs.
In the example below, even though the redirection is called for immediately, there is a 30 second pause before it occurs.
<?php
ignore_user_abort(true);
set_time_limit(0);
header('Location: http://www.example.com/');
sleep(30);
// do Something in the background
exit;
?>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.