PDA

View Full Version : Help with PHP


HabboForum
05-20-2006, 04:29 PM
Hi there,

I'm using the following code to allow access to specified IP's only. The code is in globals.php in the admincp. However, I now want to make it so I can add subnets as well.

if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1')
{
echo "Access denied";
exit;
}

Does anyone know how to make it so that I could specify subnets *as well as* IP addressees?

Thanks. :)

amykhar
05-22-2006, 02:38 PM
This might help you: http://gforge.org/snippet/detail.php?type=snippet&id=12

Paul M
05-22-2006, 02:41 PM
Crikey - the format of that is hideous here.