Right now, I have everything fine. It prints according to my CSS (text-align: center;).
the only problem I have is with the image. This is the HTML code:
<table id="cert">
<td>
<tr><h1>Singapore Aviation Academy</h1></tr>
<tr><img src = "img/logo1.jpg" /></tr>
<tr><h2>Certificate of Completion </h2></tr>
<tr>is hereby granted to</tr>
<tr><?php echo "<b>".$row['fname']." ".$row['lname']."</b>"; ?> </tr>
<tr>to certify that he/she has completed to satisfaction for</tr>
<tr><?php echo "<b>".$row1['course_title']."</b>"; ?></tr>
</td>
</table>
Right after that:
<?php
//This php will enable documents to be embedded with Microsoft Word
header("Content-type: application/msword"); //Document will be embedded using the application, Microsoft Word
header("Content-disposition: attachment; filename= \"Certificate for ".$row['fname']." ".$row['lname']."\""); //States the file name when opened to edit or view
?>
The problem is in that <img> tag. Without the last lines of PHP codes, the image appears. With it, the image just won’t show in the MS-Word.
Any idea how to solve this?
The image won’t appear when opened in Word because word is running on the client’s desktop and looking for the image locally… unless you specify a full URL for the image file, it doesn’t know to look on your server.
Options: