Dynadot

[PHP] Domain Availabilty Checker - Checks tlds

Spaceship Spaceship
Watch
Impact
3
PHP:
 Domain Availabilty Checker - Checks tlds - Version: 1.0.0.0[/b]

Hello,

This is my first script on this site, and seeing [URL=http://www.namepros.com/code/280961-php-bulk-domain-availability-check.html]Matthew. 's Script[/URL]  I decided to make one a little different. Instead of checking multiple domains, this one checks multiple tlds! 

[SIZE=4]
[B]Demo[/B][/SIZE]

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

Some of this script uses Matthews. code, I obviously have permission as Matt is a good friend and yes I did ask first.
[SIZE=4]
[B]How To Use:[/B][/SIZE]

Enter something like:

[list=a]
[*]techtuts
[*]namepros
[*]pixel2life
[*]lmao
[*]sitename
[/list] 

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 :)

[SIZE=4]
[B]The Script:[/B][/SIZE]

[PHP]<?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:

/*
| ---------------------------------------------------
| > 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:
2
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
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.
 
0
•••
Matt, I have a great idea :)

I'll talk to you about it over MSN, when you get your butt online :)
 
0
•••
Thanks. Nice one. How about additional tlds? .mobi, .cc and .in
 
0
•••
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:
	'.be' 		=> array('whois.ripe.net','No entries'),

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

Save and close.

Done :) This will be done in the next release
 
0
•••
. Adam . said:
You can easily add support for .cc, im not sure about .in and .mobi . I'll put them in the next version.

PHP:
// Add after '),

'.in' 	 => array('whois.inregistry.net', 'NOT FOUND'),
'.mobi'	=> array('whois.dotmobiregistry.net', 'NOT FOUND'),
 
0
•••
Is the .3 seconds enough to not get rate limited by TLDs like .org and .in?
 
0
•••
Dan said:
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 :)
 
0
•••
0
•••
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:
0
•••
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:
0
•••
hey I cant download because the download link is broken :(
 
0
•••
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
 
0
•••
Download link / site are down. Please repost a new url :).
 
0
•••
whitebark said:
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/free_downloads/php_scripts/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
 
1
•••
Thanks ethix - I'm going to take a look at it now.
 
0
•••
Ethix, thank you for reviving the thread!

I was looking for this!
 
0
•••
you are welcome guys/gals :)
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back