View Single Post
Old 02-16-2008, 07:25 AM   #8 (permalink)
Smiggy
New Hunter
 

Join Date: Dec 2007
Location: United Kingdom - Dorset - Bournemouth
Posts: 85
iTrader: 0 / 0%
Hunter Bux: 5.00
Smiggy will become famous soon enoughSmiggy will become famous soon enough
Send a message via MSN to Smiggy
Default

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($ fp1);
  $ 
count fgets($ fp4096);
  $ 
count += 1
  
fseek($ fp,0);
  
fputs($ fp, $ count);
  
flock($ fp3);
  
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.
Smiggy is offline   Reply With Quote