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


$im = imagecreate(50, 17);

$bg = imagecolorallocate($im, 235, 235, 235);
//$bg = imagecolorallocate($im, 023, 045, 067);

$white = imagecolorallocate($im, 255, 255, 255);
$green = imagecolorallocate($im, 0, 255, 0);
$blue = imagecolorallocate($im, 0, 0, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);
$yellow = imagecolorallocate($im, 255, 255, 0);

if ($_GET[text] != "") {
	if (strlen($_GET["text"]) == 4){
$text = $_GET[text];
$size = 8;
	} else if (strlen($_GET["text"]) > 5) {
$text = $_GET[text];
$size = 7;
} else if (strlen($_GET["text"]) == 5) {
$text = $_GET[text];
$size = 8;
	} else {
$text = $_GET[text];
$size = 9;
	}
} else {
$text = "ERROR!";
$size = 8;
}

$font = "font.ttf";



while($i <= 200) {
imagettftext($im, $i, $i, $i, 1, $black, $font, $i);
$i = $i + 1;
}

imageline($im, 5, 0, 17, 50, $red);

imageline($im, 49, 0, 0, 50, $green);

imageline($im, 35, 10, 20, 50, $blue);

//imageline($im, 5, 0, 100, 50, $yellow);

imageline($im, 30, 0, 100, 20, $white);

imagettftext($im, $size, 0, 2, 13, $white, $font, $text);


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