I have a question about exporting selected mysql data to excel. I have pulled data from a mysql table and I arranged it as I wanted.
How can I export data from current page to excel??
I have tried to use this code,
<input type= "button" onclick=location.href="export.php" value="Export"/>
this is for the export button on hrviewdate2.php file and this is export.php file:
<?php
header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=zakat.xls");
include 'hrviewdate2.php';
?>
but it just exports an html page without data that I needed.