+
+
+ | $Lang::tr{'country'} |
+ $cname  |
+
+
+ | $Lang::tr{'ptr'} |
+ $hostname |
+
+
+ | $Lang::tr{'autonomous system'} |
+ $asn $as_name |
+
+END
+
+ # Check if the address has a flag.
+ if (@network_flags) {
+ # Get amount of flags for this network.
+ my $flags_amount = @network_flags;
+ my $processed_flags;
+
+ # Loop through the array of network_flags.
+ foreach my $network_flag (@network_flags) {
+ # Increment value of processed flags.
+ $processed_flags++;
+
+ # Get the network flag name.
+ my $network_flag_name = &Location::Functions::get_full_country_name($network_flag);
+
+ # Colorize columns.
+ my $col;
+ if ($processed_flags % 2) {
+ $col = "bgcolor='$color{'color20'}'"; }
+ else {
+ $col = "bgcolor='$color{'color22'}'";
+ }
+
+ # Write table row...
+ print <
+ $network_flag_name |
+ $Lang::tr{'yes'} |
+
+END
+ }
+ }
+
+ print "
\n";
+ print " \n";
+
+ &Header::closebox();
+
my $sock = new IO::Socket::INET ( PeerAddr => $whois_server, PeerPort => 43, Proto => 'tcp');
if ($sock)
{
@@ -107,53 +187,7 @@ if (&General::validip($addr)) {
@lines = ( "$Lang::tr{'unable to contact'} $whois_server" );
}
- &Header::openbox('100%', 'left', $addr . "
(" . $hostname . ') : '.$whois_server);
-
- # Check if the address has a flag.
- if (@network_flags) {
- # Get amount of flags for this network.
- my $flags_amount = @network_flags;
- my $processed_flags;
-
- # The message string which will be displayed.
- my $message_string = "This address is marked as";
-
- # Loop through the array of network_flags.
- foreach my $network_flag (@network_flags) {
- # Increment value of processed flags.
- $processed_flags++;
-
- # Get the network flag name.
- my $network_flag_name = &Location::Functions::get_full_country_name($network_flag);
-
- # Add the flag name to the message string.
- $message_string = "$message_string" . " $network_flag_name";
-
- # Check if multiple flags are set for this network.
- if ($flags_amount gt "1") {
- # Check if the the current flag is the next-to-last one.
- if ($processed_flags eq $flags_amount - 1) {
- $message_string = "$message_string" . " and ";
-
- # Check if the current flag it the last one.
- } elsif ($processed_flags eq $flags_amount) {
- # The message is finished add a dot for ending the sentence.
- $message_string = "$message_string" . ".";
-
- # Otherwise add a simple comma to the message string.
- } else {
- $message_string = "$message_string" . ", ";
- }
- } else {
- # Nothing special to do, simple add a dot to finish the sentence.
- $message_string = "$message_string" . ".";
- }
- }
-
- # Display the generated notice.
- print "$message_string
\n";
- print "
\n";
- }
+ &Header::openbox('100%', 'left', $Lang::tr{'whois results from'} . " " . $whois_server);
print "\n";
foreach my $line (@lines) {
@@ -162,6 +196,10 @@ if (&General::validip($addr)) {
print "\n";
&Header::closebox();
} else {
+ # Open HTML page header in case of invalid IP addresses
+ &Header::openpage($Lang::tr{'ip info'}, 1, '');
+ &Header::openbigbox('100%', 'left');
+
&Header::openbox('100%', 'left', $Lang::tr{'invalid ip'});
print <