»Kullanıcı: »Şifre:   Hatırla Beni? 
Webmaster ve SEO Forumu / Kodlama / Php / php sayaç
Postalandı:  03 Aug 2009 23:21
php dosya ile aynı dizine boş bir sayac.txt dosyası oluşturun.

<?
header("Content-type: image/png");
$im = @ImageCreate (60,20)
    or die ("Cannot Initialize new GD image stream");
$background_color = ImageColorAllocate ($im, 0, 0, 0);
$text_color = ImageColorAllocate ($im, 255, 0, 0);
$f=fopen("sayac.txt","r");
$st=fgets($f, filesize("sayac.txt")+1);
$st=$st+1;
fclose($f);

$f=fopen("sayac.txt","w");
fwrite($f, $st);
fclose($f);
ImageString ($im, 2, 5, 3,  "(".$st.")", $text_color);
ImagePng($im);
imagedestroy($im);

?>