TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 291
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 221
  • Total: 222
  • @rjen

Easy counter

Started by evillair, June 09, 2007, 06:17:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

evillair

The easiest counter I found...

1. Make a counter.txt file with a the number 0, or which ever you want your counter to start with.
2. Upload it to the root of your SMF site.
3. Make sure it's writable, CHMOD it to 777.

4. Add this to a 'phpbox'


$File = "counter.txt";
$handle = fopen($File, 'r+') ;
$data = fread($handle, 512) ;
$count = $data + 1;

echo 'You are visitor number: '.$count;

fseek($handle, 0) ;
fwrite($handle, $count) ;
fclose($handle) ;


This website is proudly hosted on Crocweb Cloud Website Hosting.