You are here: Re: Count the visitor of website « PHP Programming Language « IT news, forums, messages
Re: Count the visitor of website

Posted by Sanders Kaufman on 09/29/07 03:32

"Dev" <hanudev@gmail.com> wrote in message
news:1191033370.411232.211310@50g2000hsm.googlegroups.com...
> Dear All,
> i have get combination of four PHP script for count the visitor of
> website but when i apply all these i have no answer.
> i am posting the code of all four PHP script below.

I've got a script that does that pretty well:

[code]
class hitcounter{
var $HitCount;
var $DataFile;
function hitcounter(){
$this->DataFile = "hitcount.txt";
$this->HitCount = $this->GetHitCount();
}
function GetHitCount(){
$sTMP = file_get_contents($this->DataFile,false);
if($sTMP < 1){
$iRetVal = 1;
} else {
$iRetVal = $sTMP;
}
$this->HitCount = $iRetVal;
return $iRetVal;
}
function AddHit(){
$iRetVal = (++$this->HitCount);
$oFile = @fopen($this->DataFile,"w",false);
$iBytes = fwrite($oFile,$iRetVal);
$bVoid = fclose($oFile);
$this->HitCount = $iRetVal;
return $iRetVal;
}
}
$oCounter = new bvckvs_hitcounter();
echo ("<br>Page Visits:" . $oCounter->AddHit() );

[code]

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация