Why cannot I execute a blank line at the beginning of the php file? There are only nine lines in the file, which cannot be understood.
Learning the chart control phplot,
The following is the code for test1.php, with only nine lines in total.
Require 'phplot/phplot. php ';
$ Data = array ('', 10), array ('', 1 ));
$ Plot = new PHPlot ();
$ Plot-> SetDataValues ($ data );
$ Plot-> SetTitle ('First Test plot ');
$ Plot-> DrawGraph ();
?>
The browser correctly displays the following chart:
-----------------
However, an execution error occurs when a blank line is added to the first line of the test1.php file. The source file is as follows:
The result of browser execution is as follows:
Reply to discussion (solution)
When a blank line is added to the first line, at least one line break is output before the image data stream.
The image is displayed based on the information provided by the image stream. if the previous content is too large, it cannot be parsed.
Thank you. how can I insert this chart into other webpages? For example, the code below is incorrect.
Require 'phplot/phplot. php ';
$ Data = array ('', 10), array ('', 1 ));
$ Plot = new PHPlot ();
$ Plot-> SetDataValues ($ data );
$ Plot-> SetTitle ('First Test plot ');
$ Plot-> DrawGraph ();
?>
-----------------------------------------
Insert the following line of code on other webpages to display the chart correctly.
But the problem is
Yes.
But the problem is that I cannot pass parameters to test1.php.
Thanks so much. you can pass parameters to the src of img. Close the post !~~