i tried to write simple script, which loads my page but with some important data, when it's accessed by specific IP zone or host
For example
i want to load the customized for me page when it's accessed from
125.135.145.
125.135.146.
myhost.com
my.other.host.com
<?php
if ((strpos($_SERVER['REMOTE_ADDR'], '125.135.145.')) || (strpos($_SERVER['REMOTE_ADDR'], "125.135.146.")) || (strpos($_SERVER['REMOTE_HOST'], "myhost.com")) || (strpos(
$_SERVER['REMOTE_HOST'], "my.other.host.com")))
{
header('Location: [url]http://thedomain.com/main.php?auth=me[/url]');
echo $_SERVER['REMOTE_ADDR'] ; // this is used to see which way it executes the if
echo "yes";
}
else {echo $_SERVER['REMOTE_ADDR'] ;
echo "no";}
?>
well it executes the "else" and outputs "125.135.145.8no"
I replaced the original IPs with sample ones, but the logic is the same....