PHP Study Notes: php network traffic statistics system
Note: the source of the Code is PHP and MySQL Web application development. Some of the Code has been modified and can be used after my tests. The IP address is displayed normally. My computer supports IPv6. The database script in this example ~~~ Execute set names gbk first (because the script contains Chinese characters) and then execute the statement: source d: \ test \ Vote. SQL;
Create database if not exists FluxStatCOLLATE '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 ('traffic Statistics System homepage ', 'HTTP: // localhost/test3/FluxStat/index. php', '2017-07-07 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 );
Style. the CSS style code Class file contains three files: FluxStat. php (FluxStat class), Visitors. php (Visitors class) and WebInfo. php (WebInfo class) FluxStat. php stores website visits per day