Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Simple views counter (No DB used) filter_list
Author
Message
Simple views counter (No DB used) #1
I needed this for a test, but I'm too lazy to use MySql, so I made this.

First create a "testFile.txt", and enter "0" (without quotes) in it. Then add this in a php file.

PHP Code:
<?php
$myFile 
"testFile.txt";
$fh fopen($myFile'r');
$theData fread($fh5);
fclose($fh);
intval($theData);
$theData $theData 1;

$fh fopen($myFile'w') or die("can't open file");
fwrite($fh$theData);
fclose($fh);
echo 
$theData;
?>
[Image: rytwG00.png]
Redcat Revolution!

Reply





Messages In This Thread
Simple views counter (No DB used) - by Coder-san - 06-27-2011, 06:33 PM



Users browsing this thread: 1 Guest(s)