just noTHing...
Ash to ash...Dust to dust - The Memory Remains by Metallica
Home
About me
Contact me
rss
Simple Text Counter (php)
Posted by
noTHing
at Sunday, March 22, 2009
Here is a simple php counter in text mode.
All you need to change just permission file count.txt
code:
Simple Text Counter
if (file_exists('count.txt'))
{
$fil = fopen('count.txt', r);
$dat = fread($fil, filesize('count.txt'));
echo "
";
echo $dat+1;
echo "
";
fclose($fil);
$fil = fopen('count.txt', w);
fwrite($fil, $dat+1);
}
else
{
$fil = fopen('count.txt', w);
fwrite($fil, 1);
echo '1';
fclose($fil);
}
Copy and paste the code to your php page, create count.txt file and change permission as needed
Have fun..
0 comments:
Post a Comment
Newer Post >>
<< Older Post
Home
Subscribe to:
Post Comments (Atom)
Related Articles
Followers
Recent comments
Friends Links
Watch Live Soccer
I Link Your Site [I.L.Y.S.]
YM! status
Subscribe by Email
Labels
AdSense For Any Web Site
(16)
Books Catalogue
(58)
Camfrog Video Chat
(1)
Games
(101)
Scripts
(2)
StatCounter
(1)
Tips for Easy Weight Loss
(1)
Windows Xp
(14)
Recent Posts
Archive
January
(3)
May
(2)
November
(1)
June
(18)
May
(5)
April
(2)
March
(166)
January
(1)
StatCounter
0 comments:
Post a Comment