| 
	
 | 
 Posted by Jerry Stuckle on 08/30/06 17:38 
Skybuck wrote: 
>><?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. 
>  
 
Did you try looking this up in the manual? 
 
Yes, it is possible - see  
http://www.php.net/manual/en/language.operators.logical.php. 
 
But your problem is in how your if statement is constructed.  See 
http://www.php.net/manual/en/language.control-structures.php#control-structures.if 
 
 
--  
================== 
Remove the "x" from my email address 
Jerry Stuckle 
JDS Computer Training Corp. 
jstucklex@attglobal.net 
==================
 
  
Navigation:
[Reply to this message] 
 |