Code: Select all
<?
Header("Content-type: image/png");
$s = 9;
$text = "ERROR";
$uname = "";
$sname = "";
$link = 0;
if(isset($_GETї"u"])) $uname = $_GETї"u"];
if(isset($_GETї"s"])) $sname = $_GETї"s"];
if(isset($_GETї"l"])) $link = $_GETї"l"];
$text = "$uname@$sname";
$font = "/home/webadmin/public_html/verdana.ttf";
$size = imagettfbbox($s, 0, $font, $text);
$dx = abs($sizeї2]-$sizeї0]);
$dy = abs($sizeї5]-$sizeї3]);
$pad = 3;
$w = $dx+$pad*2;
$h = $dy+$pad*2;
$im = imagecreate($w, $h);
$fg = $bg = 0;
switch($link) {
case 0: $fg=ImageColorAllocate($im, 0, 0, 0); break;
case 1: $fg=ImageColorAllocate($im, 0xC0, 0, 0); break;
case 2: $fg=ImageColorAllocate($im, 0xFF, 0xFF, 0xFF); break;
}
switch($link) {
case 0: case 1: $bg=ImageColorAllocate($im, 0xFF, 0xFF, 0xFF); break;
case 2: $bg=ImageColorAllocate($im, 0x0, 0x0, 0x0); break;
}
ImageFilledRectangle($im, 0, 0, $w, $h, $bg);
ImageTTFText($im, $s, 0, $pad, $h-$pad, $fg, $font, $text);
ImagePng($im);
ImageDestroy($im);
?>Thanks!