02-16-2008, 07:15 PM
|
#12 (permalink)
|
|
Field Master
Join Date: Jun 2007
Posts: 611
iTrader: 0 / 0%
Hunter Bux: 509.00
|
Quote:
Originally Posted by Smiggy
PHP then - Unlike the JS one, this is not my script, can't remember where I got it from:
PHP Code:
<?php
$ file = "counter.txt";
if (file_exists($ file)) {
$ fp = fopen("$ file", "r+");
flock($ fp, 1);
$ count = fgets($ fp, 4096);
$ count += 1;
fseek($ fp,0);
fputs($ fp, $ count);
flock($ fp, 3);
fclose($ fp);
echo"$ count";
} else {
echo "Cannot open file - '$ file'<BR>";
}
?>
Just make an empty text fill named counter.txt and remove the spaces between the $ and the word. ;)
|
Thanks For the script!
|
|
|