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. ;)
__________________
<!-- I can type the entire Alphabet in 2.19 seconds -->
/* (X/D)Html, Css, Javascript, Ajax, Xml (DTD), PHP, MySQL, E4X */
/* Learning C++ and German */
Last edited by Smiggy; 02-16-2008 at 07:31 AM.
|