Jump to content

Call HTML Header to download data from webpage to excel


Teaser

Recommended Posts

Hi,

 

The goal is that users will click on a image on the webpage and the data held on the page is to download into excel. Including the header and footer details on the report on the webpage. I have the below which opens up the excel document etc when the user clicks on the image but dont know how to download the data. Any assistance would be much appreciated.

<?php

 

$filename = "excel download.xls";

 

header("Pragma: public"); $display="attachment";

header('Content-Type: application/vnd.ms-excel');

header("Content-Disposition: $display; filename=$filename");

header("Cache-Control: no-cache");

 

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.