Обсуждение | Что за ерунда
Блин не пойму что за фигня не показывает картинку
кто может быть пж подскажет а то чет ослеп (старею )))) )
header("Content-type: image/gif");
$id = intval($_GET['id']);
$ip = $_SERVER['REMOTE_ADDR'];
$sait_t = mysql_query("SELECT * FROM `rekl` WHERE `time` > '".time()."' AND `id` = '".$id."'");
$account = mysql_fetch_assoc(mysql_query("SELECT * FROM `rekl` WHERE `time` > '".time()."' AND `id` = '".$id."'"));
if(mysql_num_rows($sait_t) > 0)
{
$sait = mysql_fetch_array($sait_t);
$img = 'images/'.$sait['img'].'.gif';
$image = imagecreatefromgif($img);
$old_day = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$isset = mysql_query("SELECT * FROM `host` WHERE `id_sait` = '".$id."' AND `ip` = '".$ip."' AND `time` > '".$old_day."'");
if (mysql_num_rows($isset) == 0)
{
mysql_query("INSERT INTO `host` SET
`time` = '".time()."',
`id_sait` = '".$id."',
`ip` = '".$ip."',
`browser` = 'Неизвестно',
`operator` = 'Неизвестно'");
mysql_query("UPDATE `rekl` SET `hosts` = (`hosts` + 1), `all_hosts` = (`all_hosts` + 1) WHERE `id` = '".$id."'");
mysql_query("INSERT INTO `hits` SET
`time` = '".time()."',
`id_sait` = '".$id."',
`ip` = '".$ip."',
`browser` = 'Неизвестно',
`operator` = 'Неизвестно'");
mysql_query("UPDATE `rekl` SET `hits` = (`hits` + 1), `all_hits` = (`all_hits` + 1) WHERE `id` = '".$id."'");
}else {
mysql_query("INSERT INTO `hits` SET
`time` = '".time()."',
`id_sait` = '".$id."',
`ip` = '".$ip."',
`browser` = 'Неизвестно',
`operator` = 'Неизвестно'");
mysql_query("UPDATE `rekl` SET `hits` = (`hits` + 1), `all_hits` = (`all_hits` + 1) WHERE `id` = '".$id."'");
}
$real_stat = mysql_fetch_array(mysql_query("SELECT * FROM `rekl` WHERE `id` = '".$id."'"));
$hits = 68 - (strlen($real_stat['hits']) * 5);
$hosts = 35 - (strlen($real_stat['hosts']) * 5);
$black = ImagecolorAllocate($image,0,0,0);
$white = imagecolorallocate($image,250,250,250);
ImageString($image,1,$hosts,15,$real_stat['hosts'],$white);
ImageString($image,1,$hits,15,$real_stat['hits'],$white);
}else{
$img = 'images/default.gif';
$image = imagecreatefromgif($img);
}
imagegif($image);
imageDestroy($image);
кто может быть пж подскажет а то чет ослеп (старею )))) )
header("Content-type: image/gif");
$id = intval($_GET['id']);
$ip = $_SERVER['REMOTE_ADDR'];
$sait_t = mysql_query("SELECT * FROM `rekl` WHERE `time` > '".time()."' AND `id` = '".$id."'");
$account = mysql_fetch_assoc(mysql_query("SELECT * FROM `rekl` WHERE `time` > '".time()."' AND `id` = '".$id."'"));
if(mysql_num_rows($sait_t) > 0)
{
$sait = mysql_fetch_array($sait_t);
$img = 'images/'.$sait['img'].'.gif';
$image = imagecreatefromgif($img);
$old_day = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$isset = mysql_query("SELECT * FROM `host` WHERE `id_sait` = '".$id."' AND `ip` = '".$ip."' AND `time` > '".$old_day."'");
if (mysql_num_rows($isset) == 0)
{
mysql_query("INSERT INTO `host` SET
`time` = '".time()."',
`id_sait` = '".$id."',
`ip` = '".$ip."',
`browser` = 'Неизвестно',
`operator` = 'Неизвестно'");
mysql_query("UPDATE `rekl` SET `hosts` = (`hosts` + 1), `all_hosts` = (`all_hosts` + 1) WHERE `id` = '".$id."'");
mysql_query("INSERT INTO `hits` SET
`time` = '".time()."',
`id_sait` = '".$id."',
`ip` = '".$ip."',
`browser` = 'Неизвестно',
`operator` = 'Неизвестно'");
mysql_query("UPDATE `rekl` SET `hits` = (`hits` + 1), `all_hits` = (`all_hits` + 1) WHERE `id` = '".$id."'");
}else {
mysql_query("INSERT INTO `hits` SET
`time` = '".time()."',
`id_sait` = '".$id."',
`ip` = '".$ip."',
`browser` = 'Неизвестно',
`operator` = 'Неизвестно'");
mysql_query("UPDATE `rekl` SET `hits` = (`hits` + 1), `all_hits` = (`all_hits` + 1) WHERE `id` = '".$id."'");
}
$real_stat = mysql_fetch_array(mysql_query("SELECT * FROM `rekl` WHERE `id` = '".$id."'"));
$hits = 68 - (strlen($real_stat['hits']) * 5);
$hosts = 35 - (strlen($real_stat['hosts']) * 5);
$black = ImagecolorAllocate($image,0,0,0);
$white = imagecolorallocate($image,250,250,250);
ImageString($image,1,$hosts,15,$real_stat['hosts'],$white);
ImageString($image,1,$hits,15,$real_stat['hits'],$white);
}else{
$img = 'images/default.gif';
$image = imagecreatefromgif($img);
}
imagegif($image);
imageDestroy($image);