![]() |
||||||||||
|
||||||||||
blade2k
» articles & tutorials
Easy TEXT Counter
Then create a File called counter.php. In counter.php include the following script: $file = 'counter.txt'; if(!file_exists($file)) { $handle = fopen($file, 'w'); fwrite($handle, 0); fclose($handle); } $count = file_get_contents($file); $count++; if(is_writable($file)) { $handle = fopen($file, 'w+'); fwrite($handle, $count); fclose($handle); } else { echo 'Could not increment the counter! '; } echo number_format($count).' Hits'; ?> then save. Upload this to your server. Then on your HTML(or whatever) file, make sure it ISNT .htm/.html, it must be .php. Then, where you want the counter to appear put this code: include(counter.php); ?> Any support needed? BMS me. Or, you can download the .zip of this tutorial(it contains counter.php, and counter.txt) at: http://xtremesoftware.uni.cc/counter.zip Enjoy. -Haldred |
|
|||||||||
|
©2002-2010 blade2k.net - parsed in 0.019 seconds - view active users
[19811 members][newest member: donkeyPunch]
Active Users (1)[ vincentvardia ]
|
||||||||||