Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2013, 07:54 AM   PM User | #1
RajeevK
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
RajeevK is an unknown quantity at this point
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
RajeevK is offline   Reply With Quote
Old 01-17-2013, 01:49 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,752
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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?
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
csv, live, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:16 AM.


Advertisement
Log in to turn off these ads.