NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page [PHP] Domain Availabilty Checker - Checks tlds

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 01-20-2007, 05:10 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Dec 2006
Posts: 141
Stitch is on a distinguished road
 



[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

????: NamePros.com http://www.namepros.com/code/284024-php-domain-availabilty-checker-checks-tlds.html
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;" />
        
????: NamePros.com http://www.namepros.com/showthread.php?t=284024
    </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
Last edited by . Adam .; 01-20-2007 at 05:15 PM.
Stitch is offline  
Old 01-20-2007, 05:45 PM   #2 (permalink)
Senior Member
Join Date: Dec 2006
Location: England
Posts: 1,568
Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of
 


Adoption Breast Cancer Breast Cancer Cancer Survivorship
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.
Matthew. is offline  
Old 01-20-2007, 05:50 PM THREAD STARTER               #3 (permalink)
NamePros Member
Join Date: Dec 2006
Posts: 141
Stitch is on a distinguished road
 



Matt, I have a great idea

I'll talk to you about it over MSN, when you get your butt online
Stitch is offline  
Old 01-20-2007, 07:33 PM   #4 (permalink)
 
kleszcz's Avatar
Join Date: Jul 2006
Posts: 4,607
kleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatnesskleszcz Has achieved greatness
 



Marrow Donor Program Multiple Sclerosis
Thanks. Nice one. How about additional tlds? .mobi, .cc and .in
kleszcz is offline  
Old 01-21-2007, 05:24 AM THREAD STARTER               #5 (permalink)
NamePros Member
Join Date: Dec 2006
Posts: 141
Stitch is on a distinguished road
 



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 
????: NamePros.com http://www.namepros.com/showthread.php?t=284024
Save and close.

Done This will be done in the next release
Stitch is offline  
Old 01-21-2007, 09:37 AM   #6 (permalink)
Senior Member
Join Date: Dec 2006
Location: England
Posts: 1,568
Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of
 


Adoption Breast Cancer Breast Cancer Cancer Survivorship
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 '),
????: NamePros.com http://www.namepros.com/showthread.php?t=284024

'.in'      => array('whois.inregistry.net''NOT FOUND'),
'.mobi'    => array('whois.dotmobiregistry.net''NOT FOUND'), 
Matthew. is offline  
Old 01-21-2007, 11:31 AM   #7 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Is the .3 seconds enough to not get rate limited by TLDs like .org and .in?
Dan is offline  
Old 01-21-2007, 11:39 AM   #8 (permalink)
Senior Member
Join Date: Dec 2006
Location: England
Posts: 1,568
Matthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud ofMatthew. has much to be proud of
 


Adoption Breast Cancer Breast Cancer Cancer Survivorship
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)
????: NamePros.com http://www.namepros.com/showthread.php?t=284024

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
Matthew. is offline  
Old 01-22-2007, 09:06 AM   #9 (permalink)
NamePros Regular
Join Date: May 2006
Posts: 256
3l3ctr1c has a spectacular aura about3l3ctr1c has a spectacular aura about
 



ok there goes it ajaxed -> http://www.namepros.com/code/284641-...er-checks.html
3l3ctr1c is offline  
Old 01-25-2007, 08:42 AM   #10 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 579
abcde is a jewel in the roughabcde is a jewel in the roughabcde is a jewel in the rough
 



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.
Last edited by abcde; 01-25-2007 at 10:45 PM.
abcde is offline  
Old 03-12-2007, 12:08 AM   #11 (permalink)
BlahBlahBlah...
 
navjotjsingh's Avatar
Join Date: Oct 2005
Location: India
Posts: 1,947
navjotjsingh has much to be proud ofnavjotjsingh has much to be proud ofnavjotjsingh has much to be proud ofnavjotjsingh has much to be proud ofnavjotjsingh has much to be proud ofnavjotjsingh has much to be proud ofnavjotjsingh has much to be proud ofnavjotjsingh has much to be proud of
 



Marrow Donor Program
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.
Last edited by navjotjsingh; 03-12-2007 at 12:19 AM.
navjotjsingh is offline  
Old 03-12-2007, 12:34 AM   #12 (permalink)
NamePros Regular
 
cheeta's Avatar
Join Date: Feb 2006
Location: 220.225.82.33
Posts: 389
cheeta is on a distinguished road
 



hey I cant download because the download link is broken
__________________
LiveTV.ws - Live Internet TV
cheeta is offline  
Old 03-12-2007, 12:50 AM   #13 (permalink)
Part-Time Zombie
 
whitebark's Avatar
Join Date: Jul 2006
Location: Canada
Posts: 3,495
whitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond repute
 


Protect Our Planet
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
whitebark is offline  
Old 03-29-2007, 01:10 PM   #14 (permalink)
Senior Member
 
cyberoptik's Avatar
Join Date: Aug 2003
Location: Chicago Burbs
Posts: 1,105
cyberoptik is a name known to allcyberoptik is a name known to allcyberoptik is a name known to allcyberoptik is a name known to allcyberoptik is a name known to allcyberoptik is a name known to allcyberoptik is a name known to allcyberoptik is a name known to all
 


Breast Cancer
Download link / site are down. Please repost a new url .
__________________
Website Scripts - The Best Scripts on the Web
Follow Scripteen on Facebook!
cyberoptik is offline  
Old 06-23-2007, 06:14 PM   #15 (permalink)
Senior Member
 
BeZazz's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,357
BeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud of
 




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.
????: NamePros.com http://www.namepros.com/showthread.php?t=284024

Roy
im pretty sure
http://www.cj-design.com/products/fr...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
__________________
Dolphins
OMFG!
BeZazz [US/UK] Low Cost Friendly Hosting 33% Discount Coupon 33-NPS
BeZazz is offline  
Old 06-23-2007, 06:26 PM   #16 (permalink)
Part-Time Zombie
 
whitebark's Avatar
Join Date: Jul 2006
Location: Canada
Posts: 3,495
whitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond reputewhitebark has a reputation beyond repute
 


Protect Our Planet
Thanks ethix - I'm going to take a look at it now.
whitebark is offline  
Old 06-23-2007, 07:31 PM   #17 (permalink)
Octane Media Works
 
OctaneInv's Avatar
Join Date: Apr 2007
Location: Upstate, NY
Posts: 983
OctaneInv is a name known to allOctaneInv is a name known to allOctaneInv is a name known to allOctaneInv is a name known to allOctaneInv is a name known to allOctaneInv is a name known to allOctaneInv is a name known to allOctaneInv is a name known to all
 



Ethix, thank you for reviving the thread!

I was looking for this!
__________________
shiftyMEDIA
Producing Excellence Since 2007
OctaneInv is offline  
Old 06-23-2007, 08:18 PM   #18 (permalink)
Senior Member
 
BeZazz's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,357
BeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud ofBeZazz has much to be proud of
 




you are welcome guys/gals
__________________
Dolphins
OMFG!
BeZazz [US/UK] Low Cost Friendly Hosting 33% Discount Coupon 33-NPS
BeZazz is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:52 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger