let this be sample.php
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("final_year_sample",$con);
$qt=mysql_query("select * from gd_graph");
header("Content-Type:image/jpg");
$x_gap=40;
$x_max=$x_gap*13;
$y_max=250;
$im = ImageCreate($x_max, $y_max) or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate($im, 234, 234, 234);
$text_color = ImageColorAllocate($im, 233, 14, 91);
$graph_color = ImageColorAllocate($im,25,25,250);
$x1=0;
$y1=0;
$first_one="yes";
while($nt = mysql_fetch_array($qt)){
$x2=$x1+$x_gap;
$y2=$y_max-$nt['sales'];
ImageString($im,2,$x2,$y2,$nt['month'],$graph_color);
if($first_one=="no"){
imageline($im,$x1, $y1,$x2,$y2,$text_color);
}
$x1=$x2;
$y1=$y2;
$first_one="no";
}
ImageJPEG($im);
?>
the above sample.php code works well and gives the output as output generated from above code
What i wish to do is:
I want to include the sample.php in the below HTML page
<html>
<head>
<title>Front page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="container">
<span id="title">Prototype for vehicle Routing problem Solution</span>
<div style="display:none;" id="graph_space">
<?php
include('sample.php');
?>
</div>
</div>
</body>
</html>
but i get the following error,