Login Register


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($fh, 5); 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







Users browsing this thread: 1 Guest(s)