Buy Now
Sign in

IP banning not working correctly

jimdda , September 09 2013
Hello all!

I've just installed some custom code on "on submit" on a form to ban some spammers however it does not seem to have worked? I used the code from the FAQ and simply added the IP addresses, this has worked on one form but not on the other. Please could you tell me if I've done something wrong in the code.

$banned_ips = array(
$ip_address = JRequest::getString( 'REMOTE_ADDR', '', 'server' );
if ( in_array($ip_address, $banned_ips) ) {
Hi jimdda,

You missed the commas at the end of the IP address lines after the first one.
'', // this one is good
'' // add comma here and on the following lines
. . .

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Ah! It's always something small that you miss isn't it!