Richard
01-03-2003, 07:11 PM
I made the following script, but if the user's ip is for example 102.05.62.1 then it still redirects to down.php.
I want it to check if 62. is at the beginning of the ip, not in the rest of it (like 62.152.15.2) and only redirect to down.php if it is at the beginning - how ?
<?
$ipad="$REMOTE_ADDR";
if (preg_match ("/62./", "$ipad")) {
print "<meta http-equiv=\"refresh\" content=\"00; url=http://www.whatever.com/down.php\">";
} else {
print "<meta http-equiv=\"refresh\" content=\"00; url=http://www.whatever.com/xcd.php\">";
}
?>
I want it to check if 62. is at the beginning of the ip, not in the rest of it (like 62.152.15.2) and only redirect to down.php if it is at the beginning - how ?
<?
$ipad="$REMOTE_ADDR";
if (preg_match ("/62./", "$ipad")) {
print "<meta http-equiv=\"refresh\" content=\"00; url=http://www.whatever.com/down.php\">";
} else {
print "<meta http-equiv=\"refresh\" content=\"00; url=http://www.whatever.com/xcd.php\">";
}
?>