php method to ban ip access: first create a PHP sample file; then pass "if(stripos($ban,$ip)){die("Your IP Address is:$ip,you're forbiden to...")}" method can prohibit ip access.
Recommended: "PHP Video Tutorial"
php bans a certain ip or ip address The method of segment access
Disable a single ip as follows:
ban.dat file is as follows:
BEGIN: 119.184.251.245 127.0.0.1 192.168.1.100
Disable an ip segment as follows:
The above is the detailed content of How to ban ip access in php. For more information, please follow other related articles on the PHP Chinese website!