Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $o = "Whatever content I want IN the document!";
- $fp = fopen("myfile.doc", 'w+');
- $hdr = "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"\n
- xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n
- xmlns:w=\"urn:schemas-microsoft-com:office:word\"\n
- xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\"\n
- xmlns=\"http://www.w3.org/TR/REC-html40\">\n\n
- <head>
- <meta http-equiv=Content-Type content=\"text/html; charset=windows-1252\">\n
- <meta name=ProgId content=Word.Document>\n
- <meta name=Generator content=\"Microsoft Word 12\">\n
- <meta name=Originator content=\"Microsoft Word 12\">\n
- <style>
- <!--
- /* Font Definitions */
- @font-face
- {font-family:\"MS Mincho\";
- panose-1:2 2 6 9 4 2 5 8 3 4;
- mso-font-alt:\"\FF2D\FF33 \660E\671D\";
- mso-font-charset:128;
- mso-generic-font-family:modern;
- mso-font-pitch:fixed;
- mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
- @font-face
- {font-family:\"Cambria Math\";
- panose-1:2 4 5 3 5 4 6 3 2 4;
- mso-font-charset:1;
- mso-generic-font-family:roman;
- mso-font-format:other;
- mso-font-pitch:variable;
- mso-font-signature:0 0 0 0 0 0;}
- @font-face
- {font-family:Calibri;
- panose-1:2 15 5 2 2 2 4 3 2 4;
- mso-font-charset:0;
- mso-generic-font-family:roman;
- mso-font-pitch:variable;
- mso-font-signature:-1610611985 1073750139 0 0 159 0;}
- @font-face
- {font-family:\"\@MS Mincho\";
- mso-font-charset:128;
- mso-generic-font-family:modern;
- mso-font-pitch:fixed;
- mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
- /* Style Definitions */
- p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-unhide:no;
- mso-style-qformat:yes;
- mso-style-parent:\"\";
- margin-top:0in;
- margin-right:0in;
- margin-bottom:10.0pt;
- margin-left:0in;
- line-height:115%;
- mso-pagination:widow-orphan;
- font-size:11.0pt;
- font-family:\"Calibri\",\"serif\";
- mso-ascii-font-family:Calibri;
- mso-ascii-theme-font:minor-latin;
- mso-fareast-font-family:\"MS Mincho\";
- mso-fareast-theme-font:minor-fareast;
- mso-hansi-font-family:Calibri;
- mso-hansi-theme-font:minor-latin;
- mso-bidi-font-family:Arial;
- mso-bidi-theme-font:minor-bidi;}
- .MsoChpDefault
- {mso-style-type:export-only;
- mso-default-props:yes;
- mso-ascii-font-family:Calibri;
- mso-ascii-theme-font:minor-latin;
- mso-fareast-font-family:\"MS Mincho\";
- mso-fareast-theme-font:minor-fareast;
- mso-hansi-font-family:Calibri;
- mso-hansi-theme-font:minor-latin;
- mso-bidi-font-family:Arial;
- mso-bidi-theme-font:minor-bidi;}
- .MsoPapDefault
- {mso-style-type:export-only;
- margin-bottom:10.0pt;
- line-height:115%;}
- @page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.0in 1.0in 1.0in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
- div.Section1
- {page:Section1;}
- -->
- </style>\n</head>
- <body lang=EN-US style='tab-interval:.5in'>
- <div class=Section1>";
- fwrite($fp, $hdr);
- fwrite($fp, $o);
- fclose($fp);
- header("Content-Type: application/vnd.ms-word");
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
- header("content-disposition: attachment;filename=myfile.doc");
- header("location: myfile.doc");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement