Jump to content

[SOLVED] Php GD Error


zackcez

Recommended Posts

<?PHP
header("Content-type: image/png");

$msn      = $_GET['a'];
$msn      = str_replace(".png", "", $msn);
$Back     = "background.png";
$Back2    = "background2.png";
$Font     = "font.ttf";
$Size     = getimagesize($Background);
$img      = imagecreatetruecolor($Size[0], $Size[1]);
$imgBack  = imagecreatefrompng($Background);
$Green    = imagecolorallocate($img, 0, 255, 51);
$contents = '';
$handle   = fopen("http://www.checkmsnstatus.com/msn-status-checker.php?msn=$msn&check=Check+Status","r");
if($handle){ while (!feof($handle)) { $contents .= fread($handle, 8192);} fclose($handle);}
if (stristr($contents, ">Online<")) {
	$imgBack = imagecreatefrompng($Back);
	imagecopy($img, $imgBack, 0, 0, 0, 0, $Size[0], $Size[1]);	
	imagettftext($img, 10, 0, 5, 19, 0, $Font, $msn);
	imagettftext($img, 10, 0, 225, 19, $Green, $Font, "Online");
} else {
	$imgBack = imagecreatefrompng($Back2);
	imagecopy($img, $imgBack, 0, 0, 0, 0, $Size[0], $Size[1]);	
	imagettftext($img, 10, 0, 5, 19, 0, $Font, $msn);
	imagettftext($img, 10, 0, 225, 19, 0, $Font, "Offline");
}

imagepng($img);
imagedestroy($img);
?>

 

The image “http://127.0.0.1/[email protected] cannot be displayed, because it contains errors.

 

Help is appreciated :P

Link to comment
https://forums.phpfreaks.com/topic/160999-solved-php-gd-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.