CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   CSV File download not working on live server though it works on localhost (http://www.codingforums.com/showthread.php?t=285927)

RajeevK 01-17-2013 07:54 AM

CSV File download not working on live server though it works on localhost
 
I am facing a problem with the CSV download on live though it's working on localhost.

Here is my code, please have a look -

function event_signup_download_detail($nid)
{
module_load_include('inc', 'signup_event', 'event_signup_view');
$csv_output = '';
$csv_output .= "Role,Last name,First Name,Patrol,Position,Home phone,Cell Phone,Email,Payment Date,Unit Join Date,Payment Status\n";
$nid = 2001;

// add the paid users to the csv
$csv_output .= getPaidScoutUsers($nid);

// get unpaid users, add them to the csv
$csv_output .= getUnpaidUsers($nid);

header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"Registration_Dues_Information.csv\"");
header("Pragma: no-cache");
header("Expires: 0");
print $csv_output;
exit(0);
}

Can somebody point out the issue?
I have mentioned AddType application/octet-stream .csv in my .htaccess also, so that wont be the issue I hope..

Thanks

Fou-Lu 01-17-2013 01:49 PM

Check your error logs or enable it inline with
PHP Code:

ini_set('display_errors'1);
error_reporting(E_ALL); 

Any issues with undefined functions or headers already sent?


All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.