on the fly picture problem

From: Date: Thu, 07 Aug 2003 08:34:47 +0000
Subject: on the fly picture problem
Groups: php.general 
Request: Send a blank email to php-general+get-158622@lists.php.net to get a copy of this message
I'm using jpgraph or GD for charts making, and the picture is correctly made in cache or in directory and there is no error log but when I use it in php page ( <IMG src=graph.php >, I have a no-pict icon instead of my graph. For information the graph.php script : <% $sitename="scafoot"; include("/var/www/jpgraph/src/jpgraph.php"); include("/var/www/jpgraph/src/jpgraph_line.php"); require("./connect.php"); $graph = new Graph(400,250,"auto"); $graph->SetScale("textlin"); $graph->img->SetMargin(40,20,20,40); $sql="select idstat,week(date) as week,count(*) as count from pages where host like '%$sitename%' group by week"; condb($sql,$result); $ydata=array(0); $xdata=array(0); while($row=mysql_fetch_array($result)) { array_push($xdata,$row[week]) array_push($ydata,$row[count]) } $graph->yaxis->title->Set("freq"); $graph->xaxis->title->Set("semaine"); $graph->xaxis->SetTrickLabels($xdata); $lineplot=new LinePlot($ydata); $lineplot->SetColor("blue"); $graph->Add($lineplot); Header("Content-type: image/png"); $graph->Stroke(); %>

« previous php.general (#158622) next »