Forum Moderators: coopster
<?php
$vWordFileName="export". ".doc";
header("Content-type: application/x-ms-download");
header("Content-Disposition: attachment; filename=$vWordFileName");
header('Cache-Control: public');
?>
<HTML>
<BODY>
<TABLE>
contentcontentcontent
</TABLE>
</BODY>
</HTML> header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
echo "<body>";
echo "<b>My first document</b>";
echo "</body>";
echo "</html>";
<?
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=test.doc");
$fp = fopen("nicon.doc", 'w+');
$str = "<B>This is the text for the word file created through php programming</B>";
fwrite($fp, $str);
fclose($fp);
?>