There is one way I have done this because if you use a header() function, you will get an error.
I setup a response page to let a person know the process is completed.
Then in the processing page, I will place at the beginning of the code, "Processing, Please wait...."
Instead of using the header() function, use a refresh redirect. Redirect is the only thing you can use if you render any HTML before the process code.
echo "<META HTTP-EQUIV='refresh' CONTENT='0; URL=index.php'>";