Simple counter

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Fri Nov 29, 2002 1:09 pm

simple grafic counter

Code: Select all

<?php

if ($file=file("counter.dat"))
{
$count=$file[0];
$newcount=$count+1;
$put=fopen("counter.dat", "w");
fwrite($put, $newcount);
fclose($put);


}


header ("Content-type: image/jpg");
$img = imagecreatefromjpeg ("counter.jpg");
$text_color = imagecolorallocate ($img, 109, 154, 195);
//$font=imageloadfont("01.ttf");
imagestring ($img, 80, 20, 1,  $count, $text_color);
imagejpeg($img);

?>

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest