Possible Duplicate:
Header Location + Content Disposition
I have a page that generates excel report using header content-type
and save the generation information on the database (e.g. who generated the report,when etc.) My problem is why I can't redirect the page. below is the sample code/algo
// excel content
/* excel content populates here */
// output to excel file
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=".$positionFileName);
header("Cache-Control: max-age=0");
// save logs on the database
/* save logs code executed here */
// redirect page to get the logs on the database that display on the web page
header("location: report.php"); *<--- I can't redirect to report.php*
Here is exactly what I want
the user will do is to select type of report then click button generate to output the excel report (open/save dialog). then after that, the system will going to save the logs of generated report on the database then show it on the page. that's why I want to redirect it again on report.php so that the logs will be get again on the database to display on browser.