I'm very frusterated...
I'm looking to put a WHOIS or domain checker on my website for customers to check for domains, where would I find one?

I'm also really having trouble with my PHPNuke site. If anyone knows much about that, I would love to talk to you.

I was hoping there would be some way I could put some of the features on one of my HTML pages....

Thanks!!!

    function doWhois($domain) {
      $fp = fsockopen("rs.internic.net", 43, $errno, $errstr, 10);  //connect to whois database
      if (!$fp) {
        //error
    	echo $errstr;
      } else {
    	fputs ($fp, "".$domain."\r\n"); //check domain
    	$data = null;
    	while(!feof($fp)) {
    	  $buf = fgets($fp,128);
    	  $data .= $buf;
    	}
    	$data = str_replace("\n","<br>",$data);
      }
      fclose($fp);
      return $data;
    }
    
    echo doWhois('domain.com'); //have your domain here
    

    A modified version out of a whois class i made it works just change 'domain.com ' to the domain needed. You probably wont it to be from a form.

      Internic (actually Verisign, Satan's little partner) doesn't actually give you the contact information any more. If that's what you're looking for, you have to follow the referral trail to the actual registrar. I used to use PHP to do this, but now simply invoke the GNU whois utility.

      <?
      header('Content-type: text/plain');
      $arg = escapeshellcmd($_GET['domain']);
      passthru("/usr/local/bin/whois $arg");
      ?>

      I prefer the GNU version of whois because it's more robust and is smart enough to go go to ARIN if you pass it an IP address. It's part of this package:

      http://www.gnu.org/software/inetutils/inetutils.html

        How Would I integrate that into an HTML page?

        -Jyn

        Originally posted by planetsim

        function doWhois($domain) {
          $fp = fsockopen("rs.internic.net", 43, $errno, $errstr, 10);  //connect to whois database
          if (!$fp) {
            //error
        	echo $errstr;
          } else {
        	fputs ($fp, "".$domain."\r\n"); //check domain
        	$data = null;
        	while(!feof($fp)) {
        	  $buf = fgets($fp,128);
        	  $data .= $buf;
        	}
        	$data = str_replace("\n","<br>",$data);
          }
          fclose($fp);
          return $data;
        }
        
        echo doWhois('domain.com'); //have your domain here
        

        A modified version out of a whois class i made it works just change 'domain.com ' to the domain needed. You probably wont it to be from a form. [/B]

          To integrate it into an HTML page, surround the code with <?php and ?>, like so:

          <?php
              code goes here;
          ?>
          

          I couldn't help noticing that earlier on, you said that you have "HTML pages". If by this, you mean pages with a .html file extension, you should seriously consider changing all of your sites to .php.🙂

            Write a Reply...