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
#12
(01-12-2012, 09:27 AM)BreShiE Wrote: 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?

True, but as far as I know ISP generate hostnames for a connected system, therefore each system having unique ip within the hostname... I'm not really sure about this... But..

I have 3 laptops, all share same hostname, where my neighbor (having the same ISP) has a slightly different hostname, so blocking my host name, would disable all my 3 laptops from accessing the site, while my neighbor would be able to access it since hist host name differs from mine slightly...

I'm not really sure about that, I have tested it only with me and my neighbor... Tongue
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)