Welcome Guest [Log In] [Register]
Add Reply
Đếm lượt truy cập đơn giản
Topic Started: Sep 19 2009, 05:07 AM (1,842 Views)
vinamo
Member Avatar
Administrator
--------------------------------------------------------------------------------

tạo 1 file hit.log nội dung là 0
mún hiện lượt truy cập chỗ nào thì vứt đoạn code sau vào

Code:
<? $CountFile = "hit.log";

$CF = fopen ($CountFile, "r");

$Hits = fread ($CF, filesize ($CountFile) );

fclose ($CF);

$Hits++;

$CF = fopen ($CountFile, "w");

fwrite ($CF, $Hits);

fclose ($CF);

echo ($Hits);

?>__________________
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · THƯ VIỆN MÃ NGUỒN · Next Topic »
Add Reply