Reputation: 773
is it possible to set $_SERVER['REMOTE_ADDR'] to a wildcard, so that anyone on the network can see this?
<?php
if($_SERVER['REMOTE_ADDR'] == "112.200.150.212"){
?>
<a href="http://www.tinycounter.com" target="_blank" title="free hit counter"><img border="0" alt="free hit counter" src="http://mycounter.tinycounter.com/index.php?user=fortressgate"></a>
<?php
}?>
but i want the network can see the counter... so it would look like this?
if($_SERVER['REMOTE_ADDR'] == "112.200.150.%")
is this possible?
Upvotes: 0
Views: 4693
Reputation: 324750
Two solutions:
$chk = "112.200.150.";
if( substr($_SERVER['REMOTE_ADDR'],0,strlen($chk)) == $chk)
OR:
if( preg_match("(^112\.200\.150\.)",$_SERVER['REMOTE_ADDR']))
Upvotes: 5