|
Posted by Janwillem Borleffs on 09/28/73 11:49
lorento wrote:
> I think this is the easiest :
> <?php
> $IP = $_SERVER['REMOTE_ADDR'];
> $IP_array = file('../info/1.list');
>
> if (!array_search($IP, $IP_array))
> die ("Banned");
>
This way, the script will also die when $IP occupies the first index in the
array; therefore, you should apply the identity operator:
if (false !== array_search($IP, $IP_array))
JW
Navigation:
[Reply to this message]
|