Visitor counter

0
23

<?php @session_start();
$count_my_page = ($_SERVER['DOCUMENT_ROOT']."/hitcounter.txt");
$hits = @file($count_my_page);

$counter=$hits[0];

if(!isset($_SESSION[“sid”]) && $_SESSION[“sid”]!=session_id() ){
$_SESSION[“sid”]=session_id();
$counter=$counter+1;
$fp = @fopen($count_my_page , “w”);
@fputs($fp , $counter);
@fclose($fp);
}
$hits = @file($count_my_page);
$counter=$hits[0];
$len=strlen($counter);
$str=’Hit Counter’;
//for($i=0;$i<$len;$i++){
$str .=”.$counter.”;
//}
$str .=”;echo $str;?>