<?php
error_reporting(E_ALL ^ E_NOTICE);
Header("Content-type: image/png"); //Tells the page this is an image. This must be put before any output.
$w = "100";  //Image Width
$h = "25";  //IMage Height

$QS = $_SERVER['QUERY_STRING'];

$number = ((4 * $QS)-18);

if (is_numeric($QS)) {$message = $number;}
else {$message = "Invalid input!"; $error = 1;}

$im = ImageCreate($w, $h);  //Start the image.
$background_color = imagecolorallocate($im, 220, 220, 220);  //Background color. RGB Values.
//$BorderColor = imagecolorallocate($im, 0, 10, 20);
$text = ImageColorAllocate($im, 97, 97, 95);  //Text Color     RGB Values
ImageRectangle($im,0,0,$w - 1,$h - 1,$BorderColor);  // Create the background

if (!($error == 1)){
ImageFtText ($im, 14, 0, 10, 18, $text, "courbd.ttf", "$message", array());}
elseif ($error == 1){
ImageFtText ($im, 9, 0, 2, 15, $text, "courbd.ttf", "$message", array());}

//Write the foreground Text
// 8=Font Size  0=Angle  1=Dist from top   10=Dist from left
ImagePng($im); //Draws the image
ImageDestroy($im);  //Finish the image.
?>