File size: 878B
<?php
include 'inc/db.php';
if (empty($_GET['uid'])) exit;
$uid = (int)$_GET['uid'];
$stat = @mysql_fetch_array(mysql_query("SELECT MAX(`host`) AS host, MAX(hits) AS hits FROM `counter` WHERE `id` = '$uid'"));
$hosts = $stat['host'];
$hits = $stat['hits'];
$img = @imageCreateFromPNG("img/counter.png");
$colorhit = imagecolorallocate($img, 41,28,16);
$colorhost = imagecolorallocate($img, 198,125,57);
$x1 = (ImageSX($img) - 5*strlen("$hits")-3);
$x2 = (ImageSX($img) - 5*strlen("$hosts")-5);
$y = 3;
imageString($img, 1, 2, 3,"WapViet", $colorhost);
imageString($img, 1, 38, 3,"Cc", $colorhit);
imageString($img, 1, $x1+2, $y+13,"$hits", $colorhit);
imageString($img, 1, $x2-30, $y+13,"$hosts", $colorhost);
header("Cache-Control: no-cache, must-revalidate");
Header("Content-type: image/gif");
ImageGIF($img);
ImageDestroy($img);
?>