0
    <?php
    $image = 'add.png';
    header("Expires: 0");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Content-type: application/vnd.ms-excel;charset:UTF-8");
    header("Content-Disposition: attachment; filename=filename.xls"); 
    print "\n"; // Add a line, unless excel error..
    ?>
    <table border="1">
    <tr>
    <th>header 1</th>
    <th>header 2</th>
    </tr>
    <tr>
    <td>data 1</td>
    <td><img src="C:\\xampp\\htdocs\\mysite\\engine\\pictures\\add.png"></td>
    </tr>
    </table>

This code is exporting one image into an excel sheet.I want use modify my code in order to export for example 2 images in 2 different excel sheets.Is this possible wihtout phpexcel?I want to do this with pure php,or javascript if its possible.Thanks in advance.

Ry-
  • 218,210
  • 55
  • 464
  • 476
Antreas Apostolou
  • 315
  • 2
  • 9
  • 17
  • 1
    You're not writing an Excel file, simply some HTML markup... which MS Excel can import, but only very limited. If you want multiple worksheets, use a proper library for writing Excel files such as [PHPExcel](http://phpexcel.codeplex.com/).... and don't simply set an image source to a file on your own PC, otherwise it's pretty useless to anybody else you might wish to send it to – Mark Baker Jan 16 '14 at 18:52
  • [one](http://stackoverflow.com/questions/17294770/how-create-single-html-file-to-viewed-in-excel-with-multiple-sheets), [two](http://stackoverflow.com/questions/18234448/exporting-html-tables-to-excel-xls-in-a-separate-sheet) – Nikita U. Jan 16 '14 at 18:52
  • It is not straight forward to do this as an HTML table as stated above... it is much easier to do this as an Excel XML document. See [this SO post](http://stackoverflow.com/questions/1895755/convert-xml-to-excel-with-multiple-worksheet) for how to do that. – kindrobot Jan 16 '14 at 19:00

0 Answers0