Q:

Running a php script in the background

I have a script that will take a long time to process, let me call it form1.php
Now i post from form1.php to form2.php.
On form1.php I ask the user to enter his email content to send the employs of all departments. 
Now what i need is that when i post from form1.php to form2.php, the browser should show a message that says processing.. mail will be sent to all employ email address and the user should be redirected to form2.php with out waiting for the script to send email to all employs which may take some time. I want this script to run in background and user should continue other work on site.
In the background the script must do what its supposed to do
Please give me any idea how to accomplish this?    
Thanks

A:

AJAX will fit your needs. AJAX perform an HTTP call on the background with Javascript. Still with Javascript you can create a loader or show a gif loader in the middle of the page. I suggest you not to use frames because not still supported by all browser.
Quoting W3C (WWW Consortium):

AJAX allows web pages to be updated
  asynchronously by exchanging small
  amounts of data with the server behind
  the scenes. This means that it is
  possible to update parts of a web
  page, without reloading the whole
  page.

Ajax on w3c

