// this file is (C) Eric Larson [eric at echidnoyle dot org], 27/Mar/2004. $savefile = "count.txt"; global $savedCount; //needs to be accessed throughout the page //open file and read the count # inside $fp = fopen($savefile, "r"); if ($fp) { flock($fp, 1); while (!feof($fp)) { $savedCount .= fgetc($fp); } flock($fp, 3); } @fclose($fp); function leadzero($input) { // returns a string containing # with a leading 0 (if nec.). Only pass single-digit #s! if ($input > 9) return "" . $input; else return "0" . $input; } ?>