Restricting access using IPs
| From: | Liam MacKenzie | Date: | Sat, 13 Jul 2002 05:10:22 +0000 |
| Subject: | Restricting access using IPs | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107481@lists.php.net to get a copy of this message | ||
Hey all, I'm looking to deny access to all IPs except those that fall into a
specific IP range. 192.168.0.* in this case.
Am I missing something out of this code, it don't work too well ;-)
<?
$localip = "192.168.0.13";
if ($REMOTE_ADDR == $localip) {
?>
Allowed!
<?
}
else {
?>
Denied!
<?
}
?>
Thanks in advance :-)
Liam