You are here: Re: printing to excel « PHP Language « IT news, forums, messages
Re: printing to excel

Posted by ZeldorBlat on 07/20/07 21:48

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.

 

Navigation:

[Reply to this 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

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