Simple counter

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » 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);

?>

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron