KDWeb - helping with domains.

This is just some of the first scripts. Little or no error checking and some of the URLS have been changed to protect the innocent. You will need to customize this code or just take the logic and convert it to ASP, C, etc.

With these scripts (and a bit of time) you can create a whois search like the one on this site. You can also write a link popularity checking program relatively easily (article coming soon).

If you use any of my scripts I would appreciate a link back to this site. If you email me and tell me that you linked to my site I will include a link to yours as well. Make your subject descriptive, include the words "link to your site", or something, so you don´t get deleted.

     /*
     WEB INTERFACE
     
     Basically you can do anything with this function. This just shows how to connect 
     to a web server and parse the output. This function can be used to connect to a 
     dictionary website to check your spelling, a store to check the availability of 
     a product..even auctions.
     
     Be sure to read the "Terms of Use" (or whatever its called) for each site you 
     will be connectiong to and ask permission. This can be abused and get you banned 
     from servers and services.
     */
      
     
     
     
     function checkDomain($domain){
          $fp = fsockopen("somesearch.com", 80, $errno, $errstr, 30);
          $domaincount = 0;
          if (!$fp) {
               print("$errstr ($errno)\n");
          } else {
               fputs ($fp, "GET /somesearch?domain=$domain HTTP/1.0\r\nHost: somesearch.com\r\n\r\n");
               for($i=0;$i<35;$i++) { //change 35 to whatever the minimum required rows are
                    $mystr = fgets($fp,1024);
                    $pos = strpos($mystr, "text before result ");
                    if (!($pos === false)) {
                         $pos2 = strpos($mystr, " textafter result");
                         $pos += 19; //length of "text before result"
                         $domaincount = trim(substr($mystr,$pos,$pos2-$pos));
                         break;
                    }
               }
               fclose($fp);
          }
          return $domaincount;
     }

     /* 
     WHOIS LOOKUP
     
     This is basic code to get you going. There are countless whois 
     servers out there now and not all contain all the information 
     you may be looking for.

     */
          
          
     $fp = fsockopen ("whois.someserver.com", 43, $errno, $errstr, 30);
     if (!$fp) {
         echo "$errstr ($errno)<br>\n";
     } else {
          fputs ($fp, "domain $domainame\r\n");  
          //your whois server may not support the "domain" call 
          //fputs ($fp, "$domainame\r\n");
         while (!feof($fp)){
               $mystr = fgets ($fp,500);
               print $mystr . "<br>";
               $pos = strpos($mystr, "Whois Server:");
          }
          fclose ($fp);     
     }

     ' ASP WHOIS script : no error checking
     ' You will need the w3 Sockets component for this to work
     ' It is free or $25 dollars.
     ' http://www.duplo.se/
     ' Look for products > w3 Sockets
     
     Dim tcpSock
     Dim strRetVal
     
     Set tcpSock = Server.CreateObject( "Socket.TCP" )
     
     tcpSock.Host = "whois.internic.net:43"
     tcpSock.Timeout=100
     tcpSock.Open()
     tcpSock.SendLine ("kdweb.net")
     tcpSock.WaitForDisconnect()
     'Output however you want 
     Response.Write ("<pre>")
     Response.write (tcpSock.buffer)
     Response.Write ("</pre>")

| HOME | ICANN REGISTRARS | REGISTRAR DATABASE | WHOIS SEARCH |
| WHOIS SERVERS | DNS LOOKUP | PHP/ASP SCRIPTS | ARTICLES | LINKS |
| FREE DOMAIN SEARCH |

| Home
ICANN Registrars
WHOIS Lookup
WHOIS Servers
Scripts
Articles
Links

FEATURED TEMPLATE

more templates here

Search


Search for :
Domains
Domain Names
Domain Hosting
DNS