<?php
/*
* by Barttos
* http://barttos.net/
* me@barttos.net
*/
$db_sv = mysql_connect("localhost", "root", "");
mysql_select_db("sandbox", $db_sv);
/* * */
$counter_id = intval($_GET['id']);
if ($counter_id == 0) die();
mysql_query("UPDATE counter SET visits = visits+1 Where id = $counter_id");
$r = mysql_query("SELECT visits FROM counter WHERE id = $counter_id");
$counter_array = mysql_fetch_array($r);
header("Content-type: image/png");
header("Cache-control: no-cache");
header("Pragma: no-cache" );
$counter = imagecreate(37, 27);
$background = imagecolorallocate($counter, 255, 255, 255);
$color = imagecolorallocate($counter, 0, 0, 255);
imagestring($counter, 5, 5, 5, $counter_array['visits'], $color);
imagepng($counter);
imagedestroy($counter)