| 
	
 | 
 Posted by Skybuck on 08/30/06 16:17 
> <?php 
> 
>    switch ($_SERVER['REMOTE_ADDR']) { 
>      case '143.3.5.1': 
>        header('Location: BlueIndex.htm'); 
>        break; 
>      case '124.6.15.7': 
>        header('Location: RedIndex.htm'); 
>        break; 
>      default: 
>        header('Location: DefaultIndex.htm'); 
>    } 
> ?> 
 
Hello, 
 
Is it possible to use an "or" operator in php ? I only want to specific 
the location twice, since there are only two versions of the website. 
However there can be many ip's to include, for example in pseudo code: 
 
if (RemoteAddress = '192.5.6.7') or 
   (RemoteAddress = '192.5.6.8') or 
   (RemoteAddress = '192.4.6.8') or 
   (RemoteAddress = '112.44.6.8') then 
begin 
        header('Location: RedIndex.htm'); 
end else 
begin 
        header('Location: BlueIndex.htm'); 
end; 
 
Is this possible in PHP ? 
 
Bye, 
  Skybuck.
 
  
Navigation:
[Reply to this message] 
 |