Home > php教程 > php手册 > PHP学习笔记:php网络流量统计系统

PHP学习笔记:php网络流量统计系统

WBOY
Release: 2016-06-13 08:58:27
Original
1367 people have browsed it

PHP学习笔记:php网络流量统计系统

说明:代码来源《PHP和MySQL Web应用开发》一书,还有就是代码有些是经过修改的,经过我的测验全部都可以用。

 

   这里面ip地址显示的正常的,我电脑是支持 ipv6 的。

 

 

 

本示例的数据库脚本 ~~~ 先执行 set names gbk;   (因为脚本中包含中文)再执行语句:  source d:\test\Vote.sql;

 

CREATE DATABASE IF NOT EXISTS FluxStat
COLLATE 'gb2312_chinese_ci';

USE FluxStat;
CREATE TABLE IF NOT EXISTS WebInfo (
    Id  INT  AUTO_INCREMENT  PRIMARY KEY,
    WebName VARCHAR(50), 
    WebUrl VARCHAR(200), 
    StartTime DATETIME,
    nTotalNum INT,
    nDayMax INT);

INSERT INTO WebInfo (WebName, WebUrl, StartTime, nTotalNum, nDayMax) 
VALUES ('流量统计系统首页', 'http://localhost/test3/FluxStat/index.php', '2015-07-07 0:0:0', 0, 0);

CREATE TABLE IF NOT EXISTS Visitors (
    Id  INT  AUTO_INCREMENT  PRIMARY KEY,
    vTime DATETIME,
    vIP VARCHAR(50),
    vOS VARCHAR(50), 
    vExp VARCHAR(50),
    vRef VARCHAR(50)
);

CREATE TABLE IF NOT EXISTS FluxStat  (
    Id INT AUTO_INCREMENT  PRIMARY KEY,
    D1 INT,
    D2 INT,
    D3 INT,
    D4 INT,
    D5 INT,
    D6 INT,
    D7 INT,
    D8 INT,
    D9 INT,
    D10 INT,
    D11 INT,
    D12 INT,
    D13 INT,
    D14 INT,
    D15 INT,
    D16 INT,
    D17 INT,
    D18 INT,
    D19 INT,
    D20 INT,
    D21 INT,
    D22 INT,
    D23 INT,
    D24 INT,
    D25 INT,
    D26 INT,
    D27 INT,
    D28 INT,
    D29 INT,
    D30 INT,
    D31 INT,
    MTotalNum INT
);
Copy after login

 

 

style.CSS  CSS样式代码

 

 

 

 

Class文件包含3个文件 FluxStat.php(FluxStat类) 、 Visitors.php(Visitors类) 以及 WebInfo.php(WebInfo类)

 

FluxStat.php  存放网站每天的访问数量

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