Reply to Re: Export to csv

Your name:

Reply:


Posted by bboldi on 11/16/23 11:28

You don't need to edit your php.ini, it wont help.
You can send only one header per session. Try to handle the problem in
another php file, and send only following headers:

header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=YOUR_FILE.csv");

/* generating csv files comes here */

hope it helps.

Zeff wrote:
> Hi Micha,
>
> Thanks for your suggestion. I checked out this option before, but I get
> an error message.
> "Warning: Cannot modify header information - headers already sent by
> (output started at /var/www/myfile.php:4) in /var/www/myfile.php on line
> 208"
>
> Should I edit my php.ini?
>
> Zeff
> ___
> chotiwallah wrote:
> > Zeff wrote:
> >
> >>Hi all,
> >>
> >>I'm trying to generate a csv file from an ldap query (by generating a
> >>string by concatenating with comma's - echo of the string in the browser
> >>looks fine).
> >>Is there a simple way (without using dedicated classes) to export this
> >>string to a csv file (or display the csv in the browser, so it can be saved?
> >>
> >>Thanks a lot!
> >>
> >>Zeff.
> >
> >
> >
> > header("Content-type: text/plain");
> > header("Content-Disposition: attachment; filename=YOUR_FILE.csv");
> >
> > print $YOUR_STRING;
> >
> > micha
> >

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация