<?php
//header
Header("Content-Type: image/png");
// initialize a session. //
session_start();
$w = ( $_GET['w'] !== "") ? $_GET['w'] : 200;
// set up image, the first number is the width and the second is the height//
$im = ImageCreate($w, 18);
//creates two variables to store color//
$white = ImageColorAllocate($im, 255, 255, 255);
$blue = ImageColorAllocate($im, 0, 0, 255);
$navy = ImageColorAllocate($im, 0, 0, 158);
$font = "verdanab.ttf";
$string = $_GET['s'];
$c = ( strtolower($_GET['c']) !== "") ? strtolower($_GET['c']) : 'blue';
//fill image with black//
ImageFill($im, 0, 0, $white);
//writes string //
ImageTTFText($im, 12, 0, 2, 15, $$c, $font, $string);
// output to browser//
ImagePNG($im);
ImageDestroy($im);
?>
|