The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
PS, I'll show you why this afternoon sometime!
PS, I'll show you why this afternoon sometime!
> I'd look it up myself, but you people are so much help :D
>
> PS, I'll show you why this afternoon sometime!
First, create a blank file. Name it counterlog.txt
Then create a new file. Copy/paste this into it.
$viewss = file("counterlog.txt");
$views = $viewss[0]; $views++;
$fp = fopen("counterlog.txt", "w");
fwrite($fp, $views);
fclose($fp);
print $views;
?>
Save it as counter.php. Then you use include to get the code on whichever page you want.
include ("counter.php");
?>
Upload the files and chomod counterlog.txt to 766, and you should have a brand new counter
If you ever want to change the number of visitors (You evil cheater :P), open counterlog.txt, and edit the number to what you want. Remember to chmod it again when you're finished.
I hope this is what you were after?
$var = 2;
echo $var++; // prints 2
$var = 2;
echo ++$var; // prints 3
$var = 2;
echo $var--; // prints 2
$var = 2;
echo --$var; // prints 1
?>
Any questions?
$filename = ""; // relative path to the hits file (must have 666 perm
issions)
$fp = @fopen($filename,"r");
$counterval = @fread($fp, filesize($filename));
@fclose($fp);
$counterval = (integer)$counterval + 1;
$fp = @fopen($filename,"w+");
@fwrite($fp, $counterval, 26);
@fclose($fp);
?>
Then you can just slap in wherever.
Or maybe for people without skillz... whatever. Anyway, they supress errors and warnings, which is bloody useful when you have a function that works as you want it to but displays a warning about something or other.