1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
header("Content-type: image/png");
$req = "select id_news from px where id_news = '".$_GET['px']."'";
$res = mysql_query($req, $link);
$nb = mysql_num_rows($res);
if($nb>0)
{
$aff = mysql_fetch_object($res);
$taux = $aff->$taux_ouverture + 1;
$up = "update px set taux_ouverture = '$taux' where id_news = '".$_GET['px']."'";
$res_up = mysql_query($up);
}else{
$up = "insert into px set taux_ouverture = '1', id_news = '".$_GET['px']."'";
$res_up = mysql_query($up);
}
$img = imagecreatefrompng("image.png");
imagepng($img);
imagedestroy($img); |