Discussion: printing to excel
Afficher un message
Vieux 20/07/2007, 22h48   #3
ZeldorBlat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: printing to excel

On Jul 20, 4:20 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> On Fri, 20 Jul 2007 22:07:25 +0200, gagal <lynettesm...@gmail.com> wrote:
> > I'm beginning to think I'm the queen of it worked before ... I used
> > this exact same page on another website I did. It worked
> > beautifully. On my site, it doesn't work. Instead of opening in
> > excel I get:
> > Warning: Cannot modify header information - headers already sent by
> > (output started at /home/smith/public_html/addressbook/ab_print.php:6)
> > in /home/smith/public_html/addressbook/ab_print.php on line 70

>
> > <?PHP include("../includes/connect.txt"); ?>
> > <?PHP
> > $sql = "SELECT * FROM $db_table4 ORDER BY category ASC, business ASC,

> .........
> > echo "</TABLE>";
> > header("Content-type: application/octet-stream");
> > header("Content-Disposition: attachment; filename=addressbook.xls");
> > header("Pragma: no-cache");
> > header("Expires: 0");
> > ?>

>
> Well, on the other server there's obviously some outbut buffering on. Just
> move all of your header() statements up and run them first before all
> other output or content.
> --
> Rik Wasmus


The problem could also be that display_errors is disabled on the
server.

In any event, Rik's solution should work.

  Réponse avec citation
 
Page generated in 0,04855 seconds with 9 queries