0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
webboard
/
[
Home
]
File: check_thai_ip.php
<?php if (!function_exists('___ip_in_network')) { function ___ip_in_network($ip, $net_addr, $net_mask){ if($net_mask <= 0){ return false; } $ip_binary_string = sprintf("%032b", ip2long($ip)); $net_binary_string = sprintf("%032b", ip2long($net_addr)); return (substr_compare($ip_binary_string, $net_binary_string, 0, $net_mask) === 0); } } // โหลด IP ที่อนุญาตจากไฟล์ .txt หรือกำหนดไว้ในตัวแปร $___thai_ips = file_get_contents("allow_thai_ip.txt"); // หรือใส่ตรงนี้ก็ได้ $___ips = explode("\n", $___thai_ips); $___in_range = false; foreach($___ips as $___ip) { $___tmp = explode("/", trim($___ip)); if(count($___tmp)!=2) continue; if(___ip_in_network($_SERVER['REMOTE_ADDR'], $___tmp[0], $___tmp[1])) { $___in_range = true; break; } }
©
2018.