title: Simple PHP Unique page hit counter stops after two counts?
body: <pre><code> &lt;?php  
  
   $countfile = 'counter.txt';
   $ipfile = 'ip.txt';
  
  
  
   function countint(){
     $ip = $_SERVER['REMOTE_ADDR'];
     global $countfile , $ipfile;
  
  
     if (!in_array($ip, file($ipfile, FILE_IGNORE_NEW_LINES))) {
     $current = (file_exists($countfile)) ? file_get_contents($countfile) : 0;
     file_put_contents($ipfile, $ip."\n", FILE_APPEND);
      file_put_contents($countfile, ++$current);
  
     }
  
  
  
    }
  
    countint();
      $value =file_get_contents($countfile);
  
    ?&gt;
  </code></pre>
  
  <p>This is this the count.php function included along with two file ip.txt and counter.txt</p>
  
  <p>the count is not going past 2 hits </p>
  
  <p>after two hits it stops recording  the ip address</p>