NamePros.Com (http://www.namepros.com/)
-   CODE (http://www.namepros.com/code/)
-   -   [PHP] Domain Availabilty Checker - Checks tlds (http://www.namepros.com/code/284024-php-domain-availabilty-checker-checks-tlds.html)

Stitch 01-20-2007 04:10 PM

[PHP] Domain Availabilty Checker - Checks tlds - Version: 1.0.0.0
 
Hello,

This is my first script on this site, and seeing Matthew. 's Script I decided to make one a little different. Instead of checking multiple domains, this one checks multiple tlds!


Demo


A live demo of this can be found here: http://70.85.180.226/~thetopto/Scripts/Domain_Checker/

Some of this script uses Matthews. code, I obviously have permission as Matt is a good friend and yes I did ask first.

How To Use:


Enter something like:
  1. techtuts
  2. namepros
  3. pixel2life
  4. lmao
  5. sitename

and it will return the availability of each tld told to in the script. Saves typing all domains out in matts ;)

Anyway, your waiting to see the script arent ya :)


The Script:


PHP Code:
<?php
set_time_limit
(0);
ob_start();

/*
| ---------------------------------------------------
| > Script Name: Domain Availabilty Checker
| > By: Adam
| > Website: www.portfoliosp.com
| > Version: 1.0.0.0
|
| -- Credits:
|     > With thanks to Matt Jewell (Matthew.) | www.mattjewell.com
|
| -- IMPORTANT --
|     This copyright notice must be left intact. Feel free to modify this script.
|    This script may NOT be sold under any circumstances!
| ---------------------------------------------------
*/


include 'inc/dnservers.php';    

###########################################

if(isset($_POST['submit']))
{
    
$domain = str_replace(array('www.', 'http://'), NULL, $_POST['domain']);
    
    if(
strlen($domain) > 0)
    {
        echo
'<h2>Checking Domain</h2>';
        echo
'Please wait while the results are processed....<br /><br />';
        
        foreach(
$ext as $extension => $who)
        {
            
$buffer = NULL;
                
            
$sock = fsockopen($who[0], 43) or die('Error Connecting To Server:' . $server);
            
fputs($sock, $domain.$extension . "\r\n");
                
                while( !
feof($sock) )
                {
                      
$buffer .= fgets($sock,128);
                }
                
            
fclose($sock);
                            
            if(
eregi($who[1], $buffer))
                {
                    echo
'<div style="color: green;">' . $domain . $extension .' is Available</div>';
                }
                else
                {
                    echo
'<div style="color: red;">' . $domain . $extension .' is Taken</div>';
                }
                
        
ob_flush();
        
flush();
        
sleep(0.3);
        
        }
        
        echo
'<h2>Completed</h2>';
    }
    else
    {
        echo
'Please enter the domain name';
    }
}
else
{
?>
<div style="text-align: center">
    <form method="post">
        <input type="text" name="domain" />
        <br /><br /><input type="submit" name="submit" value="Check Availability" style="font-size: 10pt;" />
        
    </form>
</div>
<?php
} // The End
?>


This is the first version of this script and may have a few bugs.

Script details:

Quote:
/*
| ---------------------------------------------------
| > Script Name: Domain Availabilty Checker
| > By: Adam
| > Website: www.portfoliosp.com
| > Version: 1.0.0.0
|
| -- Credits:
| > With thanks to Matt Jewell (Matthew.) | www.mattjewell.com
|
| -- IMPORTANT --
| This copyright notice must be left intact. Feel free to modify this script.
| This script may NOT be sold under any circumstances!
| ---------------------------------------------------
*/




Download


Download script HERE

-----

The script is free to use, and you may distribute. You must NOT sell in anyway. You can modify it if you wish. Just leave copyright intact!

Enjoy, and look out for future versions!

Please post bugs and suggestions below.

Thanks,
Adam

Matthew. 01-20-2007 04:45 PM

Smells like Matt. :)

Thanks for the credit, I'll get around to recoding mine at some point, i don't like how it's done.

Stitch 01-20-2007 04:50 PM

Matt, I have a great idea :)

I'll talk to you about it over MSN, when you get your butt online :)

kleszcz 01-20-2007 06:33 PM

Thanks. Nice one. How about additional tlds? .mobi, .cc and .in

Stitch 01-21-2007 04:24 AM

You can easily add support for .cc, im not sure about .in and .mobi . I'll put them in the next version.

But until the next version, open up inc/dnservers.php

Find:
PHP Code:
'.be'         => array('whois.ripe.net','No entries'),


Add After:
PHP Code:
'.cc'         => array('whois.nic.cc','No match'), // Requested


Save and close.

Done :) This will be done in the next release

Matthew. 01-21-2007 08:37 AM

Originally Posted by . Adam .
You can easily add support for .cc, im not sure about .in and .mobi . I'll put them in the next version.



PHP Code:
// Add after '),

'.in'      => array('whois.inregistry.net', 'NOT FOUND'),
'.mobi'    => array('whois.dotmobiregistry.net', 'NOT FOUND'),

Dan 01-21-2007 10:31 AM

Is the .3 seconds enough to not get rate limited by TLDs like .org and .in?

Matthew. 01-21-2007 10:39 AM

Originally Posted by Dan
Is the .3 seconds enough to not get rate limited by TLDs like .org and .in?



The .3 seconds was added by me to actually stop the script killing itself, if removed occasionally the script will start spitting errors. (to be exact you cannot connect to the servers)

Rate limiting is how many requests you can make to the server in a time period yes? I don't actually know, that's my guess lol.

If so i personally haven't had a problem with mine and no one else has reported one so i would assume yes to your question :)

3l3ctr1c 01-22-2007 08:06 AM

ok there goes it ajaxed -> http://www.namepros.com/code/284641...ker-checks.html

abcde 01-25-2007 07:42 AM

when i tried with ".org" i received this message:

Code:
Warning: fsockopen() [function.fsockopen]: unable to connect to whois.pir.org:43 (Connection timed out) in /home/*****/public_html/dnlookup/index.php on line 75 Error Connecting To Server:whois.pir.org



anyway, this is a great script.

navjotjsingh 03-11-2007 11:08 PM

Some problems in IE 6.

It works in IE 6 only when I click Check Availability button and not when I press enter after entering the value in search box.

cheeta 03-11-2007 11:34 PM

hey I cant download because the download link is broken :(

whitebark 03-11-2007 11:50 PM

Here is a huge request - I'd even pay for this to be included:

When a domain name is searched and found to be available the available name should become an active link to where the searcher can then register the domain. Of course the hyperlink would contain our affiliate code so we get a piece of the action.

It would need the ability to put in affiliate codes to different registrars for each .tld or group of tld's.

As well, for user satisfaction - the search box should remain displayed after a search to entice them to search again instead of closing the browser window.

Again - I will pay to have these features added.

Roy

cyberoptik 03-29-2007 12:10 PM

Download link / site are down. Please repost a new url :).

ethix 06-23-2007 05:14 PM

Originally Posted by whitebark
Here is a huge request - I'd even pay for this to be included:

When a domain name is searched and found to be available the available name should become an active link to where the searcher can then register the domain. Of course the hyperlink would contain our affiliate code so we get a piece of the action.

Roy


im pretty sure
http://www.cj-design.com/products/f.../cjdomainwhois/
does what you require and its free

EDIT: sorry bout replying to such an old thread i did notice the time stamps on the post till after i replied

whitebark 06-23-2007 05:26 PM

Thanks ethix - I'm going to take a look at it now.

OctaneInv 06-23-2007 06:31 PM

Ethix, thank you for reviving the thread!

I was looking for this!

ethix 06-23-2007 07:18 PM

you are welcome guys/gals :)


All times are GMT -7. The time now is 10:34 PM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0