首页 > 表的数据没法用折线图表示?

表的数据没法用折线图表示?

新手刚上路,有些太奇葩的代码请忽略。。。

<?php
echo"<form method=post >";
for($T=1;$T<=6;$T++)
{
echo"".$T."月:<input type=text name='stu[]'><br/>";
}
    echo"<input type=submit name=bt value='生成图'>";
echo"</form>";


if(isset($_POST['bt']))
{
 $b=$_POST['stu'];
 
$image=imagecreate(600,600);
$backgroud=imagecolorallocate($image, 255, 255, 255);
$blue=imagecolorallocate($image, 0,0, 0);
$red=imagecolorallocate($image, 255, 0, 0);

for($i=47;$i<=400;$i=$i+50)
{
imagestring($image,3, $i,390, "|", $red);
imagestring($image,3, 50,$i, "-", $red);
imagechar($image,3, 410,410, "X", $red);
imagechar($image,3, 40,50, "y", $red);
imagesetpixel($image, $i, $b, $red);
}

imageline($image,50,50,50,400,$blue);
imageline($image,50,400,400,400,$blue);

header("Content-type:image/gif");
imagegif($image);
imagedestory($image);

}
?>
【热门文章】
【热门文章】