<html><head><title>Server Lookup</title></head>
<body bgcolor=#FFFFFF text=#000000>
<?
if (eregi("[a-zA-Z]",$host)) {
  
$ip_given=0;
  
$host=preg_replace('/^[\w]*:\/\/([^\/]+)\/*.*$/''\\1'$host);
} else {
  
$ip_given=-1;
}
$hostip=gethostbyname($host);
$hostname=gethostbyaddr($hostip);

if (
$hostip==$host && $hostname==$hostip && $ip_given==0) {
  echo 
"Oops; the hostname \"$host\" doesn't seem to exist!\nSorry...\n";
} else {
  echo 
"<h3>$hostname".":"."$port<br>$hostip</h3>\n";
  
$pipe=fsockopen($host$port, &$errno, &$errstr15);
  if (!
$pipe) {
    echo 
"$errstr ($errno)<br>\n";
  } else {
    
fputs($pipe,"HEAD / HTTP/1.0\n\n");
    while (!
feof($pipe)) {
      
flush();
      
$line=fgets($pipe,9999);
      
$size += strlen($line);
      if (
eregi("Bad Request"$line)) {
        echo 
"</pre><B>Note:</B><BR>\nAll Micro\$oft II\$ \$erver\$ \$ay \"Bad Request\"; they and a few unlucky version\$ of Net\$cape Enterpri\$e are the only \$erver\$ on the planet that don't know what a HEAD reque\$t i\$...<P>\n<pre>\n";
      }
      if (
substr($line,0,7) == "Server:") {
        echo 
"<B>$line</B><BR>";
      } else {
        echo 
"$line<BR>";
      }
    }
    
fclose($pipe);
    if (
$size 15) {
      echo 
"If you don't see anything below, it's because <B>$hostname</B> is running either a Mac web server (Macs, godforsaken things that they are, don't follow the worldwide standard of how to end a line of text; they just use a line feed, while everyone else on Earth uses a carriage return) or IIS-3.0(r), which doesn't send any HTTP headers if the content type is text/html, at all, ever, apparently to prevent someone from finding out that they ARE running IIS-3.0(c). Pretty stupid, huh? Of course, if <B>I</B> were running IIS-3.0(tm), <B>I</B> sure as hell wouldn't want anyone to know about it either.<P>\n<PRE>\n";
      
$pipe=fsockopen($host$port, &$errno, &$errstr15);
      
fputs($pipe,"GET / HTTP1.0\n\n");
      
$stop_it=0;
      while (!
feof($pipe)) {
        
$line=fgets($pipe,9999);
        if (
substr(strtolower($line),0,6) == "<html>") {
          
$stop_it=-1;
        }
        if (
$stop_it==0) {
          if (
substr($line,0,7) == "Server:") {
            echo 
"<B>$line</B>";
          } else {
            echo 
"$line";
          }
        }
      }
    }
  }
}
?>
</pre>
<P><font size=1 face="Arial, Helvetica, Univers, Futura">
<U><B>The Ubiquitous, Obligatory, Omnipotent Disclaimer from Hell:</B></U><BR>
Anything on this page that can in any way be construed as a trademarked, copyrighted,
protected-by-international-law, registered, service-marked, or just plain egotistical
&quot;This is MINE!  <B><I>MINE!!!</I></B>&quot; kinda thing is trademarked, copyrighted, registered,
service-marked, or babysat by the company that thinks it &quot;owns&quot; it in the
playground of the Internet and the Real World where corporations (the "bullies" of the
playground) do all they can to keep themselves and everyone else (the "other children")
from playing nice.</font></P>
<P>If you like this page, <a href="mailto:phee@isthisthingon.org?subject=I Like This Page!">let me know!</a></P>
</body></html>