Restrict Access per IP Addresses

From: Date: Wed, 28 Feb 2001 23:58:16 +0000
Subject: Restrict Access per IP Addresses
Groups: php.general 
Request: Send a blank email to php-general+get-42097@lists.php.net to get a copy of this message
Hello, i'm Anthony from France :-) well i have a problem, i try make an authentication per range IP Address like : from 194.195.196.0 to 194.195.196.255 but it doesn't work, except if i make an authentication for only one IP Address. I tried to make with "LOOP" and "WHILE" tag, but i got the problem everytime ! This is the last example script i made with two domains which accept only the range IP Address for each : <?php $host = getenv("REMOTE_ADDR"); $ip = range(0,255); if ($host != "194.195.196.($ip)) if ($host != "195.196.197.($ip)) { header("Location: htt://www.internet.com/"); } ?> Have u got a solution please ! Thanks ! Have a nice day ! Anthony.

« previous php.general (#42097) next »