Re: JS alert that links to a file

From: Date: Mon, 27 Jul 2009 06:28:37 +0000
Subject: Re: JS alert that links to a file
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-295859@lists.php.net to get a copy of this message
Skip Evans wrote:
LinuxManMikeC wrote:
<?php header('Content-type: text/csv'); header('Content-Disposition: attachment; filename="file.csv"'); echo 'field1,field2,field3,field4'; ?>
Okay, right, I remember this. But it has to be in it's own file, otherwise you get the 'headers already sent error', right? Is there any way around that? Any way to get it right at the end of where the file is created??? Thanks! Skip
No, what he gave as an example was just right. only if you try calling header() after you echo something will it give you the header's already sent error. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare

« previous php.general (#295859) next »