Block specific IP block from my website in PHP

前端 未结 8 1504
小蘑菇
小蘑菇 2020-12-05 12:02

I\'d like, for example, block every IP from base 89.95 (89.95..). I don\'t have .htaccess files on my server, so I\'ll have to do it with PHP.

8条回答
  •  时光取名叫无心
    2020-12-05 12:33

    Make a substring :) For example for blocking 89.95.25.* you make a substring of the IP, cutting off the last two numbers and compare it to "89.95.25."

提交回复
热议问题