here is the code: <?php // Our log file; $counter = "counter.txt"; // Read log file into array; $contents = file($counter); // Total hits; $total_hits = sizeof($contents); echo $total_hits . " views "; PHP: So what I am not sure is how to protect the counter.txt from being accessed from others. What should I do, create a .htacces file or chmod? If I put this script on my remote server what should I do to protect the .txt file? Should I put it to my log folder and give any perms?