Reply to Re: Serving a website based on source internet address ?

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация