Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To Ban A Specific IP From Accessing Your Site With PHP
#11
(01-12-2012, 09:21 AM)Gaijin Wrote: You are improving BreShiE, however I have some words of advice for you...

In today's ISP world, most home systems change their IP's quite frequently, therefore you would need to manually track and log each access and figure out which IP is related to your blocked one... This simply means, if you block my IP, a router/system restart would be all I need to do in order to gain access to your site again, the workaround would be to Block a Hostname instead of an IP, since that hostname will remain same even once IP has changed... To do this just get the host name using the function gethostbyaddr(string $ip)...
http://php.net/manual/en/function.gethostbyaddr.php

It can occur that different users share the Hostname, meaning they would be also blocked, however, imo it's better to block the host name instead of a dynamic IP.

Thanks for the words of advice Gaijin, if I ever actually use this myself I'll definitely do it that way. But, isn't the hostname the pipeline? Therefore it would block anyone within the same area as him?
Reply


Messages In This Thread
RE: How To Ban A Specific IP From Accessing Your Site With PHP - by BreShiE - 01-12-2012, 09:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to track bandwidth for specific files and pages? dipped9900 1 861 07-14-2012, 05:25 PM
Last Post: 'Snorlax
  [PHP] - PHP White Paper --([-S7N-])-- 1 1,062 04-13-2010, 09:42 PM
Last Post: SLiM

Forum Jump:


Users browsing this thread: 2 Guest(s)