< ?php $filename="counter.txt"; if(!(@chmod($filename,0600))) report("Cannot write to file - $filename"); $counts=intval(loadfile($filename)); $counts++; if(savefile($filename,$counts)) report("$counts"); else report("Cannot write to file - $filename"); function savefile($fname,$data) { if(!file_exists($fname)) report("File nout found - $fname"); $f=fopen($fname,"w"); fwrite($f,$data); fclose($f); return true; } function loadfile($fname) { if(!file_exists($fname)) report("File nout found - $fname"); $f=fopen($fname,"r"); $data=fread($f,filesize($fname)); fclose($f); return $data; } function report($msg) { die("&counter=$msg&"); } header("Location: http://www.muktistar.com/main.htm"); ?>