export data as excel format from php mysql

<?php
$file
="marksreport".$_POST["txtfromdate"].".xls";



header('Content-Type: text/html'); 


header("Content-type: application/x-msexcel"); 


//tried adding  charset='utf-8' into header


header("Content-Disposition: attachment; filename=$file"); ?>




copy and past into header in page 


export to excel from project

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s