Use php to limit the number of pages browsed by each ip address on a daily basis. Using php to limit the number of pages browsed by each ip address on a daily basis, the following describes how to create a table: for example, the following copy code is as follows: CREATETABLEip_l use php to limit the number of pages browsed by each ip address on a daily basis.
Implementation: First, create a table, for example
The code is as follows:
Create table ip_log
(
Ip_log_ip VARCHAR (40 ),
Ip_log_date DATE,
Ip_log_visits TINYINT (1 ),
Ip_log_page varchar (255 ),
Primary key (ip_log_page, ip_log_ip, ip_log_date ),
);
Then, write the code and record the ip address information when the user accesses it. The initial value of browsing times is 1,
When the page number is equal to the set value, user access is not allowed.
Finally, you can run a cron table at every night to delete all data, such as using truncate
Idea: First, CREATE a TABLE. for example, the following code is as follows: create table ip_l...