![]() |
||||||||||||||
|
||||||||||||||
blade2k
» articles & tutorialsEasy TEXT Counter
Then create a File called counter.php. In counter.php include the following script: <?php $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!<br />'; } 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: <?php 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-2008 blade2k.net - parsed in 0.002 seconds - view active users
[16929 members][newest member: lugustavinho]
Active Users (1)[ ricardoga21 ]
|
||||||||||||||