<?php
$font = 3;
$image_height = intval(imageFontHeight($font) * 2);
$image_width = intval(strlen($_GET["button"]) * imageFontWidth($font) * 1.3);
$image = imageCreate($image_width, $image_height);
$back_color = imageColorAllocate($image, 216, 216, 216);
$text_color = imageColorAllocate($image, 0, 0, 255);
$rect_color = imageColorAllocate($image, 0, 0, 0);
$x = ($image_width - (imageFontWidth($font) * strlen($_GET["button"]))) / 2;
$y = ($image_height - imageFontHeight($font)) / 2;
imageString($image, $font, $x, $y, $_GET["button"], $text_color);
imageRectangle($image, 0, 0, imageSX($image) - 1, imageSY($image) - 1, $rect_color);
header("Content-Type: image/png");
imagePNG($image);
imageDestroy($image);
?>