Home > php教程 > php手册 > body text

php用文件保存数据统计网页访问人数的函数

WBOY
Release: 2016-06-13 11:17:08
Original
1335 people have browsed it

php用文件保存数据统计网页访问人数的函数  

$jishu="jishu.txt";
if(!file_exists($jishu))
{
 $kjs = fopen($jishu,"w");
 fwrite($kjs,0);
 fclose($kjs);
}
function kaishi($jishu)
{
 $js = fopen($jishu,"r");
 $du = fread($js,8);
 fclose($js);
 $du += 1;
 echo "你是本站的第".$du."位访客!!!";
 $xie = fopen($jishu,"w");
 fwrite($xie,$du);
 fclose($xie);
}
    kaishi($jishu);


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template