|
Posted by Krustov on 01/25/07 00:10
<comp.lang.php>
<Françoise Debat>
<Wed, 24 Jan 2007 10:30:10 +0100>
<45b72719$0$25947$ba4acef3@news.orange.fr>
> The banned.txt file is simple a list of IPs, one per line, as follows:
>
> 82.207.17.160
> 84.235.100.2
> 87.118.106.177
> 193.69.180.120
> 84.244.7.168
>
Theres no need to search a whole list .
Convert e.g. 127.0.0.1 to 127_0_0_1
$poop=str_replace(".","_",$poop);
www.yourdomain.com/banned/127_0_0_1
- grab the live ip address as e.g. $demo
$pass=1;
$filename="banned/$demo";
if (!file_exists($filename)) {$pass=0;}
if ($pass==0) {exit();}
In effect , You could have 10,000 banned ip addresses and the above
method would only do a single look up search instead of searching a
10,000 list of ip addresses .
--
www.phptakeaway.co.uk
(work in progress)
[Back to original message]
|