PHP Source Code of /whois.php3 -------------------------------------------------------------------------------- Last Modified: 01:44 PM 07/06/1999 Print Date: 03:57 AM 07/12/1999 Size: 4510 -------------------------------------------------------------------------------- "POST"): ?> Welcome to WHOIS/PHP !
Enter Domain Name: >
0) { ?> WHOIS Domain Lookup
".$whoisfilename; //Create temp file $x=passthru($whoiscommand); //Process if file is larger than 1 character if (filesize($whoisfilename)>1) { $fp=fopen($whoisfilename, "r"); //Process if the file was opened if ($fp) { echo "Back"; echo "
";  

                 //Loop thru temp file (process each line)   
              while (!feof($fp)){  
          $host=fgets($fp, 256);    
                  if (strlen($host)>=1) {  
             $domain=$host;  
                     echo    "Host ".(htmlspecialchars($host));  
          };  

              }  


               //Close the temp file   
              fclose($fp);  
   
                 //Remove the temp file   
              $x=passthru(   "rm -f ".$whoisfilename);   

                 //Strip out the domain name   
              $string = strtoupper(strrev($domain));  
              $tok=strtok($string,    ".");  
               
               $i=0;  
              While(($tok)&&($i<2)){  
                 if($i==1){  
                    IF($tok==   "MOC" || $tok==   "TEN" || $tok==   "GRO" || $tok==   "VOG" || $tok==   "UDE"){  
                          //We have a country code here   
                      $tmp=   "";  
                      $i--;  
               }  
         }  

                 $tmp = $tmp.   ".".$tok;   
                 $tok=strtok(   ".");  
                 $i++;  
              }  
              $domain=strrev($tmp);  

//Now use the domain to perform a WHOIS ON IT   
                
         $whoiscommand      =    "whois ".chop($domain).   ">".$whoisfilename;  
           //Create temp file   
        $x=passthru($whoiscommand);  

           //Process if file is larger than 1 character   
        if (filesize($whoisfilename)>1) {  
           $fp=fopen($whoisfilename,   "r");  

              //Process if the file was opened   
           if ($fp) {  
              echo    "
";  

                 //Loop thru temp file (process each line)   
              while (!feof($fp)){  
                 $strOut = (htmlspecialchars(fgets($fp,256)));
                 echo($strOut);
             };  

              }  

                 //Close the temp file   
              fclose($fp);  

                 //Remove the temp file   
              $x=passthru(   "rm -f ".$whoisfilename);       
}  
/////////////////////////////////////////   
              echo   "
"; echo "

"; } else { echo "Unable to open output file

"; } } else { echo "
WHOIS lookup failure.

"; } echo "Back"; } else { echo "Error!
Must have a value"; echo "Back"; } endif; -------------------------------------------------------------------------------- The syntax highlighted source is automatically generated by PHP from the plaintext script. If you want to see the source of source.php3, have a look here.