markusgreco
Newbie
- Oct 13, 2025
- 9
- 6
how ? i have cpanel, how to block, ip changes every timeyou can block the ip address from the server side
<?php
function ip_in_range($ip, $cidr) {
list($subnet, $mask) = explode('/', $cidr);
return (ip2long($ip) & ~((1 << (32 - $mask)) - 1)) == ip2long($subnet);
}
if (ip_in_range($_SERVER['REMOTE_ADDR'], '43.0.0.0/8')) {
http_response_code(403);
exit('Access denied.');
}
where to put this code ?Seems you're using php as the backend, you can block the ip request with starts with 43.
Below is a simple code for that.