Re: [PHP] allowing access to php page by IP
From: Chris Boget (chris_at_wild.net)
Date: 10/07/03
- Next message: Ben Edwards: "Verry strange GET behaviour"
- Previous message: Paul Van Schayck: "Re: allowing access to php page by IP"
- In reply to: Adam Williams: "allowing access to php page by IP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "Adam Williams" <awilliam@mdah.state.ms.us>, <php-general@lists.php.net> Date: Tue, 7 Oct 2003 09:38:12 -0500
> certain webpage and keep everyone else out. I have written code to figure
> out what someone's IP is, but am not sure about how I should verify
> whether the IP is in the range of 10.8.4.* or 10.8.5.*. Any suggestions?
$ipArray = explode( '.', $ipAddress );
if(( $ipArray[0] == 10 ) &&
( $ipArray[1] == 8 ) &&
(( $ipArray[2] >=4 ) && ( $ipArray[2] <=5 ))) {
echo 'Access granted';
} else {
echo 'Get lost, ya bum!';
}
Chris
- Next message: Ben Edwards: "Verry strange GET behaviour"
- Previous message: Paul Van Schayck: "Re: allowing access to php page by IP"
- In reply to: Adam Williams: "allowing access to php page by IP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|