Home > Backend Development > PHP Tutorial > PHP study notes:php network traffic statistics system_PHP tutorial

PHP study notes:php network traffic statistics system_PHP tutorial

WBOY
Release: 2016-07-13 09:47:10
Original
1255 people have browsed it

PHP study notes: php network traffic statistics system

Note: The code comes from the book "PHP and MySQL Web Application Development", and some of the codes have been modified, and all of them can be used after my test.
The IP address displayed here is normal. My computer supports ipv6.
The database script of this example ~~~ First execute set names gbk; (because the script contains Chinese) and then execute the statement: source d:testVote.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 style code
The Class file contains 3 files FluxStat.php (FluxStat class), Visitors.php (Visitors class) and WebInfo.php (WebInfo class)
FluxStat.php Stores the number of visits to the website every day

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1028404.htmlTechArticlePHP study notes: PHP network traffic statistics system description: code source from the book "PHP and MySQL Web Application Development", Also, some of the codes have been modified, and they all worked after my test...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template