hi,
I can't work this out and I'm new to this php stuff. I'm having a go at converting my shtml into php but can't work it out.
<old shtml code>
<!--#include virtual="/Library/people-external.lbi" -->
<!-- TEST PC -->
<!--#if expr="($REMOTE_ADDR = /193.63.253.150/) " -->
<!--#include virtual="/Library/top-external.lbi" -->
<!--#include virtual="/Library/sidemenu-external.lbi" -->
<!-- End TEST PC -->
<!--#elif expr="($REMOTE_ADDR = /192.18.195./) || ($REMOTE_ADDR = /193.63.252./) || ($REMOTE_ADDR = /193.63.253.*/) " -->
<!--#include virtual="/Library/top-internal.lbi" -->
<!--#include virtual="/Library/sidemenu-internal.lbi" -->
<!--#else -->
<!--#include virtual="/Library/top-external.lbi" -->
<!--#include virtual="/Library/sidemenu-external.lbi" -->
<!--#endif -->
</old shtml code>
so my best php to date is
<?PHP
$ip = $_SERVER['REMOTE_ADDR'];
function is_ip($ip) {
$valid = TRUE;
if(preg_match("/((192)|(168)|(1).)$/" or "/((193)|(168)|(1).)$/" or "/((193)|(168)|(1).*)$/", "$ip")) {
return TRUE;
}
else{
return FALSE;
}
return $valid;
}
if ($valid == TRUE) {
echo "help <P>";}
else {
echo $ip;
}
echo $ip;
?>
but I can't exclude an ip number, I have no idea even if this is a good way to do it ad even if this works.
hope you can help
the fish