Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Simple counter

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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);

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

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.