[How to] CIDR notation for BLOCK
-
Hi nintechnet,
your plugin is awesome and I’m trying make good use of CIDR notation to block whole blocks of hackers but it seems that it’s not working somehow. This is the code I’m using in.htninja
file:$cidr_array_no = array( 'xxx.xxx.xxx/16', 'xxx.xxx.xxx/17', 'xxx.xxx.xxx/11', 'xxx.xxx.xxx/14', 'xxx.xxx.xxx/13', 'xxx.xxx.xxx/22', 'xxx.xxx.xxx/24' ); // Loop through the array: foreach ( $cidr_array_no as $cidr ) { // Check IP vs CIDR: if ( ipCIDRCheck( $_SERVER['REMOTE_ADDR'], $cidr ) ) { // IP matches, block it: return 'BLOCK'; } }
Can you check it please?
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘[How to] CIDR notation for BLOCK’ is closed to new replies.