<?
include_once "../../config.php";

$online = mysql_fetch_array(mysql_query("SELECT * FROM `chislo` WHERE `ip` = '".$ip."'"));
if ($online['chislo']=='')exit;

$r=rand(0,0);
$img=imagecreatefromgif("fon/$r.gif");


$d1 = substr($online['chislo'], 0,1);
$r=rand(0,4);
$img_d=imagecreatefromgif("dig/$r.gif");
imagecopy($img, $img_d,rand(-3,3)-2, rand(-4,4), $d1*20, 0,  20, 30);

$d1 = substr($online['chislo'], 1,1);
$r=rand(0,4);
$img_d=imagecreatefromgif("dig/$r.gif");
imagecopy($img, $img_d,rand(-3,3)+10, rand(-4,4), $d1*20, 0,  20, 30);

$d1 = substr($online['chislo'], 2,1);
$r=rand(0,4);
$img_d=imagecreatefromgif("dig/$r.gif");
imagecopy($img, $img_d,rand(-3,3)+25, rand(-4,4), $d1*20, 0,  20, 30);

$d1 = substr($online['chislo'], 3,1);
$r=rand(0,4);
$img_d=imagecreatefromgif("dig/$r.gif");
imagecopy($img, $img_d,rand(-3,3)+40, rand(-4,4), $d1*20, 0,  20, 30);


//imagecopy($img, $img1, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h)
header("Content-type: image/gif");
imagegif($img);
?>
