include ('edit.me'); # set a session ID session_start(); # This is the bit which adds to the count.txt file if ($count_what == 'visitors') { # First it creates a session Id for each visit so that it counts # visits rather than how many times a page is loaded. if (!$PHPSESSID) { $thefile = file("counter/counter.txt"); $count = implode("", $thefile); $count++; $myfile = fopen("E:\\agricredito.it\\counter\\counter.txt","w"); fputs($myfile,$count); fclose($myfile); } # done } else { # Else it will count every page load $thefile = file("counter/counter.txt"); $count = implode("", $thefile); $count++; $myfile = fopen("E:\\Inetpub\\agricredito.it\\counter\\counter.txt","w"); fputs($myfile,$count); fclose($myfile); } ?>