| 
 Posted by Jerry Stuckle on 08/29/06 18:21 
Skybuck wrote: 
> Hello, 
>  
> Based on the source internet address a different version of the website 
> should be presented/served to the user/browser. 
>  
> I would like to keep the script as simple as possible and it should 
> replace the index.php. 
>  
> The script could look something like this in pseudo code: 
>  
> if SourceAddress = '143.3.5.1' then 
> begin 
>   ShowBlueWebsite;  // load/show BlueIndex.htm 
> end else 
> if SourceAddress = '124.5.15.7' then 
> begin 
>   ShowRedWebsite; // load/show RedIndex.htm 
> end; 
>  
> Is this possible with php ? 
>  
> Bye, 
>   Skybuck. 
>  
 
Sure. 
 
<?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'); 
   } 
?> 
 
--  
================== 
Remove the "x" from my email address 
Jerry Stuckle 
JDS Computer Training Corp. 
jstucklex@attglobal.net 
==================
 
  
Navigation:
[Reply to this message] 
 |