255 || $Octets[1] < 0 || $Octets[1] > 255 || $Octets[2] < 0 || $Octets[2] > 255 || $Octets[3] < 0 || $Octets[3] > 255 || $Octets[0] == 127 || ($Octets[0] == 192 && $Octets[1] == 168) ) { die('Invalid IP.'); } $Host = lookup_ip($_GET['ip']); if ($Host === '') { trigger_error("get_host() command failed with no output, ensure that the host command exists on your system and accepts the argument -W"); } elseif ($Host === false) { print 'Could not retrieve host.'; } else { print $Host; }