Trouble with the output of a csv-file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Stefan Heitmann
Forum Newbie
Posts: 4
Joined: Tue Jun 19, 2007 8:38 am

Trouble with the output of a csv-file

Post by Stefan Heitmann »

Hello,

my problem is in fact that i have an cms like application in php, my template is given out as string via the echo-function. But whenever i just want to give out my csv-file for download there is also a bit of template-code included. This must be because of the fact, that the header function cannot be stoped after the csv-code is given out.

How can i solve this problem?

Grettz

Stefan
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Trouble with the output of a csv-file

Post by volka »

Stefan Heitmann wrote:This must be because of the fact, that the header function cannot be stoped after the csv-code is given out.
:?:

We probably need to know more about your code.
Stefan Heitmann
Forum Newbie
Posts: 4
Joined: Tue Jun 19, 2007 8:38 am

Post by Stefan Heitmann »

Ok, in fact i just give out the csv-code via echo, using the header method, but the header method is also giving out the source of my page, because the page-source is also included in a var.

One solution which could possibly work is writing the output into another php-file.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

No I'm even more confused. What's the header method and how is it connected to echo?
Post Reply