Hello everyone
I am very new in php and jpgraph. So I'll try to explain as best as possible. First, I work on Windows XP but I'm connected to a Debian Linux server that have installed Apache and PHP. I download the file jpgraph-3.0.7.tar.bz2 and I unzipped. I found a src folder that contains many files, including file jpgraph.php. Then copy this folder to the folder /www/b033/ into Linux server. It is the only folder that I have access. Using Dreamweaver I created in the folder /www/b033/ a php file called "graphic" and in this file I paste one example I found among the files in the folder src. The graphic file code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GRAFICO</title>
</head>
<body>
<?php
//phpinfo();
// content="text/plain; charset=utf-8"
require_once ('src/jpgraph.php');
require_once ('src/jpgraph_line.php');
// Some data
$ydata = array(11,3,8,12,5,1,9,13,5,7);
// Create the graph. These two calls are always required
$graph = new Graph(350,250);
$graph->SetScale('textlin');
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetColor('blue');
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
?>
</body>
</html>
Then I go to my browser, enter the address
http://b033.grupoxion.com/grafico.php and shows me the following message:
JpGraph Error: HTTP headers have already been sent.
Caused by output from file grafico.php at line 8.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).
Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.
For example it is a common mistake to leave a blank line before the opening "<?php".
I have no idea because I get this.
Please I need your help, urgent.
Thank you very much.