Newsgroup: it.comp.www.php
Titolo: Problema con jpgraph

Ciao a tutti,
sto usando jpgraph per fargli fare dei grafici a torta ma mi genera questi 
warning:
Warning: Cannot modify header information - headers already sent by (output 
started at /srv/www/htdocs/provacrc/archivio.php:8) in 
/srv/www/htdocs/jpgraph/jpgraph.php on line 5875
Warning: Cannot modify header information - headers already sent by (output 
started at /srv/www/htdocs/provacrc/archivio.php:8) in 
/srv/www/htdocs/jpgraph/jpgraph.php on line 5876
Warning: Cannot modify header information - headers already sent by (output 
started at /srv/www/htdocs/provacrc/archivio.php:8) in 
/srv/www/htdocs/jpgraph/jpgraph.php on line 5877
Warning: Cannot modify header information - headers already sent by (output 
started at /srv/www/htdocs/provacrc/archivio.php:8) in 
/srv/www/htdocs/jpgraph/jpgraph.php on line 5878
Warning: Cannot modify header information - headers already sent by (output 
started at /srv/www/htdocs/provacrc/archivio.php:8) in 
/srv/www/htdocs/jpgraph/jpgraph.php on line 5880
Non riesco a capire dove sta il problema.
Ecco il codice che dovrebbe generare il grafico:
<?php
//Setta le variabili per la connessione al db
$Host = "localhost";
$User = "root";
$Password = "";
$DBName = "monitor";
$Tablename = "storico_crc";
$Link = mysql_connect($Host, $User, $Password);
mysql_select_db($DBName,$Link) or die ("Impossibile connettersi!");
$querytutti =mysql_query ( "SELECT * from $Tablename ");
$numtot=mysql_num_rows($querytutti);
mysql_select_db($DBName,$Link) or die ("Impossibile connettersi!");
$querygialli =mysql_query ( "SELECT * from $Tablename where colore='yellow' 
");
$numgialli=mysql_num_rows($querygialli);
mysql_select_db($DBName,$Link) or die ("Impossibile connettersi!");
$queryrossi =mysql_query ( "SELECT * from $Tablename where colore='red' ");
$numrossi=mysql_num_rows($queryrossi);
include ("/srv/www/htdocs/jpgraph/jpgraph.php");
include ("/srv/www/htdocs/jpgraph/jpgraph_pie.php");
$data = array($numgialli,$numrossi);
$graph = new PieGraph(300,200,"auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$p1 = new PiePlot($data);
$graph->Add($p1);
$graph->Stroke();
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
$Query = "SELECT data, oid0,variazione, colore from $Tablename order by 
oid0,data";
        if (!$Result = mysql_db_query ($DBName, $Query, $Link))
                print ("La query non riesce in interfaces!!!!<br>");
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
   print ("<br>\n");
print ("<TABLE BORDER=1 WIDTH=\"75%\" CELLSPACING=2 CELLPADDING=2 
ALIGN=CENTER>");
   print ("<tr ALIGN=CENTER BGCOLOR=#FFCCCC VALIGN=TOP>\n");
   print ("<td ALIGN=CENTER BGCOLOR=#FFCCCC VALIGN=TOP><b>DATA</b></td>\n");
   print ("<td ALIGN=CENTER BGCOLOR=#FFCCCC 
VALIGN=TOP><b>LINEA</b></td>\n");
   print ("<td ALIGN=CENTER BGCOLOR=#FFCCCC 
VALIGN=TOP><b>VARIAZIONE</b></td>\n");
   print ("</tr>\n");
   while (list($data,$oid0,$variazione,$colore) = 
mysql_fetch_array($Result))
        {
                if ($colore == "yellow")
                {
                $separadataeora=explode(" ",$data);
                $componidata=explode("-",$separadataeora[0]);
                $componiora=explode(":",$separadataeora[1]);
                $dataweb="$componidata[2]-$componidata[1]-$componidata[0]";
                $oraweb="$componiora[0]:$componiora[1]";
                print ("<tr ALIGN=CENTER VALIGN=TOP>\n");
                print ("<tr ALIGN=CENTER VALIGN=TOP>\n");
//              print ("<td ALIGN=CENTER BGCOLOR=#FFFF99 
VALIGN=TOP>$data</td>\n");
                print ("<td ALIGN=CENTER BGCOLOR=#FFFF99 VALIGN=TOP>$dataweb 
$oraweb</td>\n");
                print ("<td ALIGN=CENTER BGCOLOR=#FFFF99 
VALIGN=TOP>$oid0</td>\n");
                print ("<td ALIGN=CENTER BGCOLOR=#FFFF99 
VALIGN=TOP>$variazione</td>\n");
                print ("</tr>\n");
                }
                else
                {
                $separadataeora=explode(" ",$data);
                $componidata=explode("-",$separadataeora[0]);
                $componiora=explode(":",$separadataeora[1]);
                $dataweb="$componidata[2]-$componidata[1]-$componidata[0]";
                $oraweb="$componiora[0]:$componiora[1]";
                print ("<tr ALIGN=CENTER VALIGN=TOP>\n");
                print ("<tr ALIGN=CENTER VALIGN=TOP>\n");
//              print ("<td ALIGN=CENTER BGCOLOR=#FF9966 
VALIGN=TOP>$data</td>\n");
                print ("<td ALIGN=CENTER BGCOLOR=#FF9966 VALIGN=TOP>$dataweb 
$oraweb</td>\n");
                print ("<td ALIGN=CENTER BGCOLOR=#FF9966 
VALIGN=TOP>$oid0</td>\n");
                print ("<td ALIGN=CENTER BGCOLOR=#FF9966 
VALIGN=TOP>$variazione</td>\n");
                print ("</tr>\n");
                }
        }
mysql_close ($Link);
print ("</TABLE>\n");
?>
Grazie a tutti.
Ciao
Andrea 

 Andrea
jpgraph stà cercando di inviare degli header.. ma è già stato generato un
output da /srv/www/htdocs/provacrc/archivio.php:8
-- 
www.iuz-lab.info

Adesso mi genera questo errore:
JpGraph Error: Can't delete cached image ciao1. Permission problem?
Eppure ciao1 ha 777 come permessi (root:root user e group)......
Qualcuno mi sa aiutare?
Grazie mille.
Ciao
Andrea