Hi..
I am very new to perl.
I am getting a lot of unwanted visitors posting obsenities on my notice board and other such boards.
At the moment I have a list of ip numbers within the script:
$remote_ip = $ENV{REMOTE_ADDR};
if(
($remote_ip eq "194.83.57.154")
|| ($remote_ip eq "121.127.81.60")
|| ($remote_ip eq "121.143.108.207")
|| ($remote_ip eq "124.51.183.147")
|| ($remote_ip eq "125.182.104.63")
|| ($remote_ip eq "140.109.40.252")
etc...
{
exit;
}
I have a list of ip numbers and would like to put them into a text file so that all scripts can use the same list of unwanted ip numbers.
e.g
$badIps = "bad-ip-file.txt";
if( search-for-ip($remote_ip, $badIps) )
{
exit;
}
Can anybody help me by telling me how to code it???
Thanks
John C
I am very new to perl.
I am getting a lot of unwanted visitors posting obsenities on my notice board and other such boards.
At the moment I have a list of ip numbers within the script:
$remote_ip = $ENV{REMOTE_ADDR};
if(
($remote_ip eq "194.83.57.154")
|| ($remote_ip eq "121.127.81.60")
|| ($remote_ip eq "121.143.108.207")
|| ($remote_ip eq "124.51.183.147")
|| ($remote_ip eq "125.182.104.63")
|| ($remote_ip eq "140.109.40.252")
etc...
{
exit;
}
I have a list of ip numbers and would like to put them into a text file so that all scripts can use the same list of unwanted ip numbers.
e.g
$badIps = "bad-ip-file.txt";
if( search-for-ip($remote_ip, $badIps) )
{
exit;
}
Can anybody help me by telling me how to code it???
Thanks
John C