I am trying to export my data in a php page and it's not working. I am getting the data from the database and then displaying in the code. At the end of the page I have the following code:
if($excel == "yes"){
header("Content-Type: application/vnd.ms-excel; name='excel'");
header("Content-disposition: attachment; filename=" .date("Y-m-d").".xls");
}
What am I doing wrong?