A,flat,file,counter,php

Yavuz 9/1/2016 0

A flat file counter in PHP

PHP
<? 
$visitor_ip = $HTTP_COOKIE_VARS["user_ip"]; 
$counter = "counter.txt"; 
$counter_file_line = file($counter); 

if(!$vistor_ip) 
{ 
  setcookie("user_ip", $REMOTE_ADDR, time() 360000); 
  $counter_file_line[0]  ; 
  $cf = fopen($counter, "w "); 
  fputs($cf, "$counter_file_line[0]"); 
  fclose($cf); 
} 
elseif($vistor_ip != $REMOTE_ADDR) 
{ 
  $counter_file_line[0]  ; 
  $cf = fopen($counter, "w "); 
  fputs($cf, "$counter_file_line[0]"); 
  fclose($cf); 
} 
?>
 

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments