|
ho fatto cosi' ... ma ad ogni refresh o apertura della pagina vedo sempre stampato 1
<?
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
if (!file_exists("../counter.txt")) {
$file=fopen("counter.txt","w");
$num=0;
}
else {
$file=fopen("../counter.txt","r+");
$num=fgets($file,20);
fseek($file, 0);
}
$num++;
//print("Visualizzazioni Sign: ".$num);
//fputs($file,$num);
//fclose($file);
fputs($file,$num);
fclose($file);
imagestring($im, 1, 5, 5,$num, $text_color);
imagepng($im);
imagedestroy($im);
?>
come rimedio ????
__________________
|