For the life of me I don't know why this isn't working....
I am checking for ip addresses and I have three options. Addresses that start as 172.25. or 172.24. all others default as off-campus.
Here is my code:
print "<p>Ip =$REMOTE_ADDR";
function GetLocation()
{
if (ereg('172.25.', $REMOTE_ADDR))
$location = "on-campus";
elseif (ereg('172.24.', $REMOTE_ADDR))
$location = "on-campus";
else
$location = "off-campus";
return $location;
}
$location = GetLocation();
print "<p>Location = $location";
This is what is displayed:
Ip =172.24.142.***
Location = off-campus
Any Help as to why this skips my if and elseif statement?