| Server IP : 172.67.201.108 / Your IP : 216.73.216.11 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/mitzvahm/wwwdevplanner/ |
Upload File : |
<?php
ob_start();
?>
<html>
<head>
<title>Office 365 Test - DOCX</title>
</head>
<body>
<table>
<tr>
<td>
Test 1
</td>
<td>
Test A
</td>
</tr>
<tr>
<td>
Test 2
</td>
<td>
Test B
</td>
</tr>
<tr>
<td>
Test 3
</td>
<td>
Test C
</td>
</tr>
</table>
</body>
</html>
<?php
$filename = 'Mitzvah_Organizer_Test.docx';
$html = ob_get_clean();
//header("Content-type: application/vnd.ms-word");
header("Content-type: application/ms-word");
/*
header("Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document");
*/
header("Content-Disposition: attachment; filename=".$filename);
/*
$zip = new ZipArchive;
$doc = new DOMDocument();
$doc->loadHTML($html);
var_dump($doc);
$xml = $doc->saveXML();
echo $xml;
*/
//header( 'Content-Type: application/msword' );
//header("Content-disposition: attachment; filename=" .date("Y-m-d").".doc");
/*
header("Content-type: application/vnd.ms-word");
header("Content-disposition: attachment; filename=" .date("Y-m-d").".rtf");
*/
$html = preg_replace('%/[^\\s]+\\.(jpg|jpeg|png|gif)%i', 'http://www.akubocrm.com\\0', $html);
print "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"";
print "xmlns:o=\"urn:schemas-microsoft-com:office:office\"";
print "xmlns:w=\"urn:schemas-microsoft-com:office:word\"";
print "xmlns=\"http://www.w3.org/TR/REC-html40\">";
print "<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:DoNotHyphenateCaps/>
<w:PunctuationKerning/>
<w:DrawingGridHorizontalSpacing>9.35 pt</w:DrawingGridHorizontalSpacing>
<w:DrawingGridVerticalSpacing>9.35 pt</w:DrawingGridVerticalSpacing>
</w:WordDocument>
</xml>
";
//die($html);
echo $html;
?>