can only be accessed in a limited range of IP addresses
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
function get_real_ipaddress () {if!empty ($_server[' Http_c Lient_ip ']) {return $_server[' http_client_ip ']; ElseIf (!empty ($_server[' http_x_forwarded_for ')) {return $_server [' Http_x_forwarded_for ']; Return $_server[' REMOTE_ADDR ']; function In_ip_range ($ip, $ip _one, $ip _two = False) {if (! $ip _two) {return $ip _one = = $ip.} return Ip2long ($ip _one) * -1 >= Ip2long ($IP) *-1 && ip2long ($ip _two) *-1 <= ip2long ($IP) *-1; function Validate_ip () {$ip = explode (': ', get_real_ipaddress ()); $ip = $ip [0]; if (In_ip_range ($ip, ' 212.76.229.115 ', ' 212.76.229.120 ')) {return true;} else if (In_ip_range ($ip, ' 194.78.4.66 ', ' 194.78.4.79 ')) {return true;} else if (In_ip_ Range ($ip, ' 194.8.4.78 ', ' 194.8.4.78 ')) {return true;} else if (In_ip_range ($ip, ' 0 ', ' 1 ")) {//local return true;} hea Der(' location:http://www.3lian.net '); } |
I hope this article will help you with your PHP program design.