Log in

View Full Version : Export to word from php



shankari
11-09-2007, 08:07 AM
Hi frnds,
i have a prob in exporting to word.
i'm able to export it to the word when the program asks for confirmation(ok or cancel in the dialog box ) to open the word if i click cancel it is showing a blank page instead of the orginal(program) page.


the headers that i've used are



header("Pragma: public");
header("Content-Disposition: attachment; filename=\"".basename($file_name)."\";");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
pls help me
//header("Cache-Control: private", false);
header("Content-Type: application/octet-stream");

djr33
11-09-2007, 09:15 AM
I believe this happens because you are opening a .php page which only outputs the file directly; the blank page is a placeholder for any html the php page would output, which in this case never exists.