Home > php教程 > PHP源码 > 计算访问次数。

计算访问次数。

WBOY
Release: 2016-06-06 09:32:31
Original
1123 people have browsed it
跳至 [1] [全屏预览]
$last_view = session('last_view_service');
        $time = time();
        if ($last_view + 10 < $time) { //每10秒计算一次。10秒内访问算一次
            $data['uid'] = $this->uid;
            $data['type'] = 'service';
            $data['row_id'] = $aId;
            $data['to_uid'] = $service['uid'];
            D('WekoStat')->addVisit($data);
            session('last_view_service', $time, 20);
        }
Copy after login
Related labels:
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