-1
收到錯誤消息:代碼是不能工作得到錯誤
無法顯示,因爲它包含了一些錯誤。
<?php
include("connection.php");
$height = 200;
$width = 200;
$border = 30;
if($_GET['height']) {$height = $_GET['height'];}
if($_GET['width']) {$width = $_GET['width'];}
if($_GET['border']) {$border = $_GET['border'];}
Header('Content-type: image/jpeg');
$image = ImageCreate($width+$border, $height+$border);
$white = ImageColorAllocate($image, 255, 255, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$blueish = ImageColorAllocate($image, 120, 120, 255);
$redish = ImageColorAllocate($image, 222, 66, 66);
$grayish = ImageColorAllocate($image, 200, 200, 200);
$purpleish = ImageColorAllocate($image, 200, 10, 200);
ImageFill($image, 0,0, $black);
ImageFilledRectangle ($image, 0,0,$border,$height+$border, $grayish);
ImageFilledRectangle ($image, 0,$height, $border+$height,$border+$width, $grayish);
$sql = "SELECT Battery FROM battery_level ORDER BY DESC";
$result = mysqli_query($sql, $conn);
$num = mysqli_num_rows($result);
$den = $num*2+1;
$xspacing = intval($width/$den);
$pos = -1;
while ($row = mysqli_fetch_array($result))
{
$pos = $pos +2;
$left = $pos*$xspacing;
$right = ($pos+1)*$xspacing;
}
ImageJpeg($image);
ImageDestroy($image);
?>
在瀏覽器中查看源代碼,你會看到這個'圖像'有什麼錯誤 – nospor
你真的認爲這是可讀嗎? –
PHP的錯誤文件中記錄了什麼? –