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+AJAX] 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-22-2007, 09:05 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: May 2006
Posts: 256
3l3ctr1c has a spectacular aura about3l3ctr1c has a spectacular aura about
 



Cool [PHP+AJAX] Domain Availabilty Checker - Checks tlds


Hey everyone!

First credits go to ADAM and MATTEW for the basic script all I did to this was made it AJAX.

Demo :


A live demo goes here at my blog http://www.hakc.net/scripts/domainjax/

I've got to add much more to this script so beat at your seats! I'll be adding more web 2.0 features!

Script
The Index file :
Code:
<html>
<body>
<head>
<title></title>
</head>
<link href="main.css" rel="stylesheet" />

<script language="javascript" type="text/javascript" src="ajax.js"></script>
<center>
	<form method="post" action="./" id="form">
		<input type="text" name="domain" />
		<br /><br /><input type="submit" value="Check Availability" style="font-size: 10pt;" />
		
	</form>
		<div id="loading"><img src="inc/loading.gif"></img></div>
 <div id="results"></div>	
 </center>
 </body>
 </html>
The AJAX handler :
????: NamePros.com http://www.namepros.com/code/284641-php-ajax-domain-availabilty-checker-checks.html

Code:
var xml = makeXML();
var form;
var loading;
var results;
function makeXML () {
	if (typeof XMLHttpRequest == 'undefined') {
		objects = Array(
			'Microsoft.XmlHttp',
			'MSXML2.XmlHttp',
			'MSXML2.XmlHttp.3.0',
			'MSXML2.XmlHttp.4.0',
			'MSXML2.XmlHttp.5.0'
		);
		for (i = 0; i < objects.length; i++) {
			try {
				return new ActiveXObject(objects[i]);
			} catch (e) {}
		}
	} else {
		return new XMLHttpRequest();
	}
}
window.onload = function () {
	form = document.getElementById('form');
	loading = document.getElementById('loading');
	results = document.getElementById('results');
	form.onsubmit = function () {
		results.style.display = 'none';
		results.innerHTML = '';
		loading.style.display = 'inline';
		xml.open('get', './process.php?domain=' + escape(this.domain.value));
		xml.onreadystatechange = function () {
			if (xml.readyState == 3 && xml.status == 200) {
				results.style.display = 'block';
				results.innerHTML = xml.responseText;
				loading.style.display = 'none';
			}
		}
		xml.send(null);
		return false;
	}
}
Download the complete Package here !

Script is totally free to use modify and use anywhere wanted, but cannot be sold under any circumstances.

-- 3l3ctr1c
3l3ctr1c is offline  
Old 01-22-2007, 09:11 AM   #2 (permalink)
NamePros Member
Join Date: Dec 2006
Posts: 141
Stitch is on a distinguished road
 



Not bad, but AJAX really needed for 1 submit form?

I dont think AJAX is necessary for this.
Stitch is offline  
Old 01-22-2007, 10:58 AM   #3 (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 .
Not bad, but AJAX really needed for 1 submit form?
????: NamePros.com http://www.namepros.com/showthread.php?t=284641

I dont think AJAX is necessary for this.
Although they are my words (adam - ) it depends on how it is used i guess, personally for something like this i don't recommend ajax but i suppose it does no harm.

Thanks for the credits 3l3ctr1c
Matthew. is offline  
Old 01-22-2007, 11:35 AM   #4 (permalink)
NamePros Member
Join Date: Dec 2006
Posts: 141
Stitch is on a distinguished road
 



lol

Yea thanks for credits
Stitch is offline  
Old 01-23-2007, 03:39 AM THREAD STARTER               #5 (permalink)
NamePros Regular
Join Date: May 2006
Posts: 256
3l3ctr1c has a spectacular aura about3l3ctr1c has a spectacular aura about
 



I felt like ajaxing it, and did it, but I love to see AJAX everywhere! Actually the ready.state was set to 3 so that results can be shown as they're fetched but I don't know what changed after it went to my host.
3l3ctr1c is offline  
Old 01-25-2007, 08:47 AM   #6 (permalink)
Senior Member
 
Hitch's Avatar
Join Date: Aug 2005
Location: Uk, South Yorkshire
Posts: 1,225
Hitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to behold
 


Winner
PHP Programming - May 2007
Animal Rescue Third World Education Find Marrow Donors!
I prefer AJAX actually.

Gives it a more, modern, professional feel.
__________________
Cueburst - Support System - FAQ Knowledge Base, Tickets and more.
Hitch is offline  
Old 02-17-2007, 06:35 PM   #7 (permalink)
Formerly Array
 
-NB-'s Avatar
Join Date: Feb 2006
Location: San Diego, CA
Posts: 228
-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all-NB- is a name known to all
 



What about credit to me for coming up with that beautiful AJAX system? Stealing code and claiming as your own is not cool
-NB- is offline  
Old 02-17-2007, 06:38 PM   #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 -NB-
What about credit to me for coming up with that beautiful AJAX system? Stealing code and claiming as your own is not cool
None of my business but if you're going to post in a public forum accusing the OP of stealing code, then would it not be prudent to post some sort of proof?

Matt
Matthew. is offline  
Old 02-17-2007, 06:59 PM   #9 (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
I posted this before this was posted and it's an AJAX domain checker.

-NB-, I don't think you invented AJAX and it's not the most beautiful thing I've ever seen.
Dan is offline  
Old 03-12-2007, 12:09 AM   #10 (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
It does not work in IE 6 and IE 7. Shows javascript error in status bar and script keeps on searching...no results. Please fix it.
navjotjsingh is offline  
Old 03-18-2007, 11:36 AM   #11 (permalink)
Senior Member
 
killaklown's Avatar
Join Date: Oct 2003
Posts: 3,472
killaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to behold
 



Nice script, but it seems a little buggy at times.
killaklown is offline  
Old 03-18-2007, 12:46 PM   #12 (permalink)
cef
NamePros Regular
Join Date: May 2004
Location: NYC
Posts: 236
cef is a jewel in the roughcef is a jewel in the roughcef is a jewel in the rough
 


Animal Rescue
Yupl, a little buggy. I typed in stargate.com (where I have my server) and got this back:

Quote:
stargate.com.com is Available
stargate.com.net is Available
stargate.com.org is Available
stargate.com.biz is Available
stargate.com.tv is Available
stargate.com.info is Available
stargate.com.co.uk is Taken
stargate.com.nl is Taken
stargate.com.ca is Taken
stargate.com.name is Taken
stargate.com.ws is Available
stargate.com.be is Taken
First, because com.com is taken, Nothing else under it should be listed as available.

That said, the script should parse input a little better to account for how TLDs are actually used (e.g. .co.uk vs. .com.com sort of thing) and to strip/not strip things as appropriate (also add TLDs if none present).
????: NamePros.com http://www.namepros.com/showthread.php?t=284641

Other than that, looks nice so far.
cef is offline  
Old 03-18-2007, 01:48 PM THREAD STARTER               #13 (permalink)
NamePros Regular
Join Date: May 2006
Posts: 256
3l3ctr1c has a spectacular aura about3l3ctr1c has a spectacular aura about
 



I'll try to fix them up asap.

3l3ctr1c
3l3ctr1c 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 05:24 AM.

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