prova ad usare $_SERVER['REMOTE_ADDR'] al posto di $REMOTE_ADDR.

ciao
gnegno