I want to create a word document for download with some information and Im trying to figure out how to create a page header (everything else works just fine).
I also do not want to install some docx libraries.
Code: Select all
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=$filename.doc");
//charset=Windows-1252
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
echo "<thead>";
echo "WHY CANT I GET THIS #"¤% LINE INTO THE PAGEHEADER?????";
echo "</thead>";
echo "<body>";
echo "<div style ='font:9px/19px Arial,tahoma,sans-serif;color:#000000;text-align:right;'> <b> ".$string."</b></div>";
echo "<div class=Section1>";
echo "<img src=\"".$target_dir." \">";
echo "</div>";
echo "<div style ='font:11px/21px Arial,tahoma,sans-serif;text-align:right;color:#cccccc'> blablabla</div>";
echo "<b>Subject</b> <br>";
echo "<br>";
echo "<div style ='font:13px/23px Arial,tahoma,sans-serif;color:#000000;border-bottom: 1px dotted #003366;'><b> blablabla</b></div>";
if(isset($DBP)){echo "<div style ='font:11px/21px Arial,tahoma,sans-serif;color:#000000'> <b> ".$DBP.$Pinfo."</div>";}
echo "</body>";
echo "</html>";
Thanks