From 3c19fdabd36778f397001499074a0bd9cefc42a2 Mon Sep 17 00:00:00 2001 From: beenull Date: Mon, 8 Jan 2024 13:32:25 +0000 Subject: [PATCH] Update index.php --- index.php | 444 +++++++++++++++++++++++++++--------------------------- 1 file changed, 222 insertions(+), 222 deletions(-) diff --git a/index.php b/index.php index a27939a..f18e561 100644 --- a/index.php +++ b/index.php @@ -1,223 +1,223 @@ - - - - - - Domain Name, IP Whois Search System - NibbleGap - - - - - - - - - -

nibblegap logo Domain Name, IP WHOIS Search System

-
- - - -
- - '; - if (!empty($result)) { - echo '

' . $domain . ' WHOIS Information

'; - echo '
'; - echo '

Searched from: ' . $server . '

'; - echo '

Domain Registration: ' . ($isRegistered ? 'Registered' : 'Unregistered') . '

'; - echo '

Reserved domain name: ' . (isDomainReserved($result) ? 'Reserved' : 'Not Reserved') . ' (Only Reference)' . '

'; - - foreach ($result as $line) { - if (strpos($line, 'Expiration Date') !== false || strpos($line, 'Registrar Registration Expiration Date') !== false || strpos($line, 'Registry Expiry Date') !== false || strpos($line, 'Expiry Date:') !== false || strpos($line, 'Expiration Time:') !== false) { - echo '

Expiration Date: ' . trim(str_replace(['Expiration Date:', 'Registrar Registration Expiration Date:', 'Registry Expiry Date:', 'Expiry Date:', 'Expiration Time:'], '', $line)) . '

'; - } - elseif (strpos($line, 'Creation Date') !== false || strpos($line, 'Domain Registration Date') !== false || strpos($line, 'created:') !== false || strpos($line, 'Registration Time:') !== false) { - echo '

Registration Date: ' . trim(str_replace(['Creation Date:', 'Domain Registration Date:', 'created:', 'Registration Time:'], '', $line)) . '

'; - } - elseif (strpos($line, 'Updated Date') !== false || strpos($line, 'Last Updated') !== false || strpos($line, 'last-update:') !== false) { - echo '

Last Updated Date: ' . trim(str_replace(['Updated Date:', 'Last Updated:', 'last-update:'], '', $line)) . '

'; - } - elseif (strpos($line, 'Name Server') !== false || strpos($line, 'Name Servers') !== false || strpos($line, 'NS') !== false || strpos($line, 'nserver:') !== false) { - echo '

DNS: ' . trim(str_replace(['Name Server:', 'Name Servers:', 'NS:', 'nserver:'], '', $line)) . '

'; - } - elseif (strpos($line, 'Registrant:') !== false || strpos($line, 'Registrant Name:') !== false || strpos($line, 'Registrant Organization:') !== false) { - echo '

Registrant: ' . trim(str_replace(['Registrant:', 'Registrant Name:', 'Registrant Organization:'], '', $line)) . '

'; - } - elseif (strpos($line, 'Registrant Email') !== false) { - echo '

Registrant Email: ' . trim(str_replace('Registrant Email:', '', $line)) . '

'; - } - elseif (!$hasRegistrarInfo && (strpos($line, 'Registrar:') !== false || strpos($line, 'Registrar WHOIS Server') !== false || strpos($line, 'registrar:') !== false)) { - echo '

Registrar: ' . trim(str_replace(['Registrar:', 'Registrar WHOIS Server:', 'registrar:'], '', $line)) . '

'; - $hasRegistrarInfo = true; - } - elseif (strpos($line, 'Status:') !== false) { - echo '

Status: ' . trim(str_replace('Status:', '', $line)) . '

'; - } - } - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo '
    '; - foreach ($result as $line) { - echo '
  • ' . $line . '
  • '; - } - echo '
'; - echo '
'; - echo '
'; - } else { - echo '

WHOIS information for the domain name could not be found. The domain name may not be registered or the domain Whois server is not accessible.

'; - } - echo ''; - } else { - echo '
'; - echo '

WHOIS search for this domain name is not supported.

'; - echo '
'; - } - } - - function performIPWhoisQuery($ip) - { - $server = 'whois.apnic.net'; - $result = queryWhoisServer($server, $ip); - - echo '
'; - if (!empty($result)) { - echo '

' . $ip . ' WHOIS information

'; - echo '

Searched from: ' . $server . '

'; - echo ''; - } else { - echo '

IP WHOIS information not available.

'; - } - echo '
'; - } - - function getDomainExtension($domain) - { - $parts = explode('.', $domain); - $extension = end($parts); - return strtolower($extension); - } - - function queryWhoisServer($server, $query) - { - $result = array(); - $fp = @fsockopen($server, 43, $errno, $errstr, 10); - if ($fp) { - fputs($fp, $query . "\r\n"); - while (!feof($fp)) { - $result[] = fgets($fp); - } - fclose($fp); - } - return $result; - } - - function isDomainReserved($whoisResult) - { - $reservedKeywords = array('reserved', 'reserved domain name', 'keep', 'clientHold', 'serverHold'); - - foreach ($whoisResult as $line) { - foreach ($reservedKeywords as $keyword) { - if (stripos($line, $keyword) !== false) { - return true; - } - } - } - - return false; - } - - function isDomainRegistered($whoisResult) - { - $registeredPatterns = array( - '/^\s*Registrar:\s+/i', - '/^\s*Creation Date:\s+/i', - '/^\s*Domain Name:\s+/i', - '/^\s*Registry Domain ID:\s+/i', - '/^\s*connect\s+/i', - '/^\s*Status:\s+connect/i', - '/^\s*Status:\s+active/i' - ); - - foreach ($whoisResult as $line) { - foreach ($registeredPatterns as $pattern) { - if (preg_match($pattern, $line)) { - return true; - } - } - } - - return false; - } - ?> - - - - + + + + + + Domain Name, IP Whois Search System - NibbleGap + + + + + + + + + +

nibblegap logo Domain Name, IP Whois Search System

+
+ + + +
+ + '; + if (!empty($result)) { + echo '

' . $domain . ' WHOIS Information

'; + echo '
'; + echo '

Searched from: ' . $server . '

'; + echo '

Domain Registration: ' . ($isRegistered ? 'Registered' : 'Unregistered') . '

'; + echo '

Reserved domain name: ' . (isDomainReserved($result) ? 'Reserved' : 'Not Reserved') . ' (Only Reference)' . '

'; + + foreach ($result as $line) { + if (strpos($line, 'Expiration Date') !== false || strpos($line, 'Registrar Registration Expiration Date') !== false || strpos($line, 'Registry Expiry Date') !== false || strpos($line, 'Expiry Date:') !== false || strpos($line, 'Expiration Time:') !== false) { + echo '

Expiration Date: ' . trim(str_replace(['Expiration Date:', 'Registrar Registration Expiration Date:', 'Registry Expiry Date:', 'Expiry Date:', 'Expiration Time:'], '', $line)) . '

'; + } + elseif (strpos($line, 'Creation Date') !== false || strpos($line, 'Domain Registration Date') !== false || strpos($line, 'created:') !== false || strpos($line, 'Registration Time:') !== false) { + echo '

Registration Date: ' . trim(str_replace(['Creation Date:', 'Domain Registration Date:', 'created:', 'Registration Time:'], '', $line)) . '

'; + } + elseif (strpos($line, 'Updated Date') !== false || strpos($line, 'Last Updated') !== false || strpos($line, 'last-update:') !== false) { + echo '

Last Updated Date: ' . trim(str_replace(['Updated Date:', 'Last Updated:', 'last-update:'], '', $line)) . '

'; + } + elseif (strpos($line, 'Name Server') !== false || strpos($line, 'Name Servers') !== false || strpos($line, 'NS') !== false || strpos($line, 'nserver:') !== false) { + echo '

DNS: ' . trim(str_replace(['Name Server:', 'Name Servers:', 'NS:', 'nserver:'], '', $line)) . '

'; + } + elseif (strpos($line, 'Registrant:') !== false || strpos($line, 'Registrant Name:') !== false || strpos($line, 'Registrant Organization:') !== false) { + echo '

Registrant: ' . trim(str_replace(['Registrant:', 'Registrant Name:', 'Registrant Organization:'], '', $line)) . '

'; + } + elseif (strpos($line, 'Registrant Email') !== false) { + echo '

Registrant Email: ' . trim(str_replace('Registrant Email:', '', $line)) . '

'; + } + elseif (!$hasRegistrarInfo && (strpos($line, 'Registrar:') !== false || strpos($line, 'Registrar WHOIS Server') !== false || strpos($line, 'registrar:') !== false)) { + echo '

Registrar: ' . trim(str_replace(['Registrar:', 'Registrar WHOIS Server:', 'registrar:'], '', $line)) . '

'; + $hasRegistrarInfo = true; + } + elseif (strpos($line, 'Status:') !== false) { + echo '

Status: ' . trim(str_replace('Status:', '', $line)) . '

'; + } + } + echo '
'; + echo ''; + echo '
'; + echo '
'; + echo '
    '; + foreach ($result as $line) { + echo '
  • ' . $line . '
  • '; + } + echo '
'; + echo '
'; + echo '
'; + } else { + echo '

WHOIS information for the domain name could not be found. The domain name may not be registered or the domain Whois server is not accessible.

'; + } + echo ''; + } else { + echo '
'; + echo '

WHOIS search for this domain name is not supported.

'; + echo '
'; + } + } + + function performIPWhoisQuery($ip) + { + $server = 'whois.apnic.net'; + $result = queryWhoisServer($server, $ip); + + echo '
'; + if (!empty($result)) { + echo '

' . $ip . ' WHOIS information

'; + echo '

Searched from: ' . $server . '

'; + echo ''; + } else { + echo '

IP WHOIS information not available.

'; + } + echo '
'; + } + + function getDomainExtension($domain) + { + $parts = explode('.', $domain); + $extension = end($parts); + return strtolower($extension); + } + + function queryWhoisServer($server, $query) + { + $result = array(); + $fp = @fsockopen($server, 43, $errno, $errstr, 10); + if ($fp) { + fputs($fp, $query . "\r\n"); + while (!feof($fp)) { + $result[] = fgets($fp); + } + fclose($fp); + } + return $result; + } + + function isDomainReserved($whoisResult) + { + $reservedKeywords = array('reserved', 'reserved domain name', 'keep', 'clientHold', 'serverHold'); + + foreach ($whoisResult as $line) { + foreach ($reservedKeywords as $keyword) { + if (stripos($line, $keyword) !== false) { + return true; + } + } + } + + return false; + } + + function isDomainRegistered($whoisResult) + { + $registeredPatterns = array( + '/^\s*Registrar:\s+/i', + '/^\s*Creation Date:\s+/i', + '/^\s*Domain Name:\s+/i', + '/^\s*Registry Domain ID:\s+/i', + '/^\s*connect\s+/i', + '/^\s*Status:\s+connect/i', + '/^\s*Status:\s+active/i' + ); + + foreach ($whoisResult as $line) { + foreach ($registeredPatterns as $pattern) { + if (preg_match($pattern, $line)) { + return true; + } + } + } + + return false; + } + ?> + + + + \ No newline at end of file