עבר עריכה לאחרונה בתאריך 14.08.06 בשעה 20:20 על-ידי FireAngel (סגן מנהל)
לכל מי שרוצה : <? $targetIps = array();$targetIps[sizeof($targetIps)] = "82."; $targetIps[sizeof($targetIps)] = "127.0"; function GetClientIPAddr() { $xForwardedFor = getenv("HTTP_X_FORWARDED_FOR"); if (trim($xForwardedFor) != "") { if (strstr($xForwardedFor,",")) { $ipArray = explode(",",$xForwardedFor); foreach($ipArray as $IP) { if(ereg ("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}", $IP)) { return $IP; } } return getenv("REMOTE_ADDR"); } else { if(ereg ("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}", $xForwardedFor)) { return $xForwardedFor; } else { return getenv("REMOTE_ADDR"); } } } else { return getenv("REMOTE_ADDR"); } }
$ip_legal = true;
foreach($targetIps as $IP) { $ip_pos = strpos(GetClientIPAddr(),$IP); if ($ip_pos === 0) { $ip_legal = false; break; } } if ($ip_legal) { ?> Your IP: <? echo getenv("REMOTE_ADDR"); ?><br> Sorry, for the moment, your IP is closed to run the forum.<br> for more information please send us an Email.<br> infrom: your country and your IP number infront of you.<br> click: <a href="http://rotter.net/kesher">http://rotter.net/kesher</a> to send the Email.<br> <? }else{ echo "IP is OK"; } ?>
|