Home >Backend Development >PHP Tutorial >PHP web page number counter code_PHP tutorial

PHP web page number counter code_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:58:07816browse

php web page number counter code This php counter is a simple counter code used to count the number of visits to a web page. It uses txt text files and the php fopen function to operate.

php tutorial web page number counter code
This php counter is a simple counter code used to count the number of visits to a web page. It uses txt text files and the php fopen function to operate.
*/

$log = 'log/count.txt';
$count_img = 'img/counter';

$fp = @fopen($log, "r+") or die($log.'The data file cannot be opened!');
$count = fgets($fp, 64);
flock($fp, 2);
$count = (int)$count + 1;
rewind($fp);
fputs($fp, $count);
fclose($fp);
if($conf_showcount == '1'){
for ($i=0; $i $num = substr($count, $i, 1);
echo '';
}
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632044.htmlTechArticlephp web page number counter code This php counter is a simple number used to count the number of visits to a web page The programmer code uses txt text files and the php fopen function to operate. php tutorial...
Statement:
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