Hej, nie mogę utworzyć obrazka. W firefox pokazuje się komunikat o tym, że obrazek nie może zostać wyświetlony, ponieważ zawiera błędy.
<?php
include_once 'query.php';
$hostserwa = $_GET['ip'];
$portserwa = $_GET['port'];
$status = new MinecraftServerStatus();
$response = $status->getStatus($hostserwa.':'.$portserwa);
$ipserwera = "$hostserwa:$portserwa";
if(!$response) {
$gracze = "0/0";
$nazwa = "The Server is offline!";
}
else{
$gracze = ''.$response['players'].'/'.$response['maxplayers'].'';
$nazwa = $response['motd'];
}
$czcionka = "ARIALBD.TTF";
$image = imagecreatefrompng('b1.png');
$bialy = imagecolorallocate($image, 255, 255, 255);
imagettftext($image, 8, 0, 30, 8, $bialy, $czcionka, $nazwa);
imagettftext($image, 9, 0, 160, 18, $bialy, $czcionka, $gracze);
imagettftext($image, 9, 0, 30, 18, $bialy, $czcionka, $ipserwera);
header('Content-type: image/png'); imagepng($image);
imagedestroy($image);
?>