I am writing a php script to send mails to all the email addresses in a particular mailing list. The mails might run into thousands and the entire script can take even hours to execute. What I want is the once the user enter the mail details, body, subject etc and hits a button/link, the php script runs in background and the user is redirected to some page as soon as he hits the button/link.
In short the php script should be initiated from the browser but should run on the server even if the browser is closed.
Alternatively if a progress bar can be shown on redirected page using AJAX/Javascript but the php script should continue executing even if the browser is closed.