PHP learning notes: php network traffic statistics system. PHP learning notes: php network traffic statistics system description: the code is from the book PHP and MySQLWeb application development, and some code has been modified, all of my tests are available in 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); 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. CSS style code
The 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
Tips: The source of the code is PHP and MySQL Web application development, and some of the code has been modified. after my tests, all of them are available...