Tuesday, August 3, 2010

Graphic counter

Graphic counter. 
!!! Dont forget to create count.txt file and cmod 777
if your server does not support Gif image create, use png image create.
Replace 
header('Content-Type: image/GIF');
ImageGIF ($im);

with
header('Content-Type: image/PNG');
ImagePNG ($im);

thats all

PHP Code:
// Image Counter Scriptif(!file_exists("count.txt"))
{
$counter=fopen("count.txt""a");}
else
{
$counter=fopen("count.txt""r+");}$aufruf=fgets($counter,100);$aufruf=$aufruf+1;rewind($counter);fputs($counter,$aufruf);fclose($counter);$im = @ImageCreate (9946//change the image size hereor die ("Kann keinen neuen GD-Bild-Stream erzeugen");$background_color ImageColorAllocate ($im255255255);$text_color ImageColorAllocate ($im25500);ImageString ($im211"$aufruf"$text_color2); header('Content-Type: image/GIF');ImageGIF ($im);?>

No comments:

Post a Comment