Results 1 to 2 of 2

Thread: Export to word from php

  1. #1
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Export to word from php

    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");
    Last edited by shankari; 11-09-2007 at 09:05 AM.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •