Developer Support »

Storing banned IP addresses centrally for using with more than one copy of the script  (See more user questions)

Hi .

Got a solution for your centrally stored banned IPs file.

Make a file. Call it by any name. In this example it's banned_ips.txt.
Put your banned IP addresses in it, separated by commas.

Delete this line in the script:

$banned_ips = array();

Replace it with this line:

$banned_ips =
explode(",",file_get_contents("http://www.example.com/banned_ips.txt"));

That's it.

Some points:

In your banned IPs file, don't use any line breaks, put all the IP addresses
on one line, separated by commas. Don't put a comma at the end of the line.
Don't make any spaces in the line. Don't put quotes around the address.
Just like this:

44.22.233.21,82.24.56.1,224.130.87.113

The file needs to be stored in a web-accessible location, so it might be
better to give it an obscure name, like:

$banned_ips =
explode(",",file_get_contents("http://www.example.com/banned_ips_urutyfdhhgu4u3i23i23ufi4.txt"));

...not that it can come to any harm.

You still need to enable the banned IPs check in the script, like so:

$banned_ips_check = 1;

For the file_get_contents() function to work, you need to have
"allow_url_fopen" enabled in the PHP setup, in php.ini. It is enabled by
default.

Any questions, just let me know.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

>> Comments: Hi!
>>
>> Love the script and use it with all my sites.
>>
>>
>> My clients get spammed a lot for hand entered India based con biz - I
>> tracked their ip range to 122. and can block it with the form but it
>> would require entering that in every usage I have - i was wondering if
>> you ever wrote a little insert to go to a specific url and file stored on
>> my server that lists all the ip's I want to block. That way I could
>> manage it more efficiently and update it quickly to block the hand entry
>> spammers - it would need to be on a different domain than the web form -
>> if you have please let me know what to do - if not and you can do that
>> let me know what it would cost to write that for me.
>>
>> Thanks!
>>
>> You have the best form script product in the market!