01-22-2007, 08:05 AM
· #1 DNOA Member
Join Date: May 2006
Posts: 256
NP$: 68.15 (
Donate )
[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 :
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
01-22-2007, 08:11 AM
· #2 NamePros Member
Not bad, but AJAX really needed for 1 submit form?
I dont think AJAX is necessary for this.
01-22-2007, 09:58 AM
· #3 Stud Sausage
Location: England
Join Date: Dec 2006
Posts: 1,545
NP$: 32.41 (
Donate )
Originally Posted by . Adam . Not bad, but AJAX really needed for 1 submit form?
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
01-22-2007, 10:35 AM
· #4 NamePros Member
lol
Yea thanks for credits
01-23-2007, 02:39 AM
· #5 DNOA Member
Join Date: May 2006
Posts: 256
NP$: 68.15 (
Donate )
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.
01-25-2007, 07:47 AM
· #6 Adrian
Name: Adrian
Location: Uk, South Yorkshire
Join Date: Aug 2005
Posts: 1,227
NP$: 16.00 (
Donate )
I prefer AJAX actually.
Gives it a more, modern, professional feel.
__________________
NamePros
02-17-2007, 05:35 PM
· #7 Formerly Array
Name: Nick Berlette
Location: San Diego, CA
Join Date: Feb 2006
Posts: 229
NP$: 139.50 (
Donate )
What about credit to me for coming up with that beautiful AJAX system? Stealing code and claiming as your own is not cool
02-17-2007, 05:38 PM
· #8 Stud Sausage
Location: England
Join Date: Dec 2006
Posts: 1,545
NP$: 32.41 (
Donate )
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
02-17-2007, 05:59 PM
· #9 Buy my domains.
Name: Dan
Join Date: Feb 2006
Posts: 2,801
NP$: 54.00 (
Donate )
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.
03-11-2007, 11:09 PM
· #10 BlahBlahBlah...
Name: Navjot Singh
Location: India
Join Date: Oct 2005
Posts: 1,941
NP$: 0.51 (
Donate )
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.
03-18-2007, 10:36 AM
· #11 Senior Member
Name: Justin
Location: Winnipeg, Canada
Join Date: Oct 2003
Posts: 3,467
NP$: 0.06 (
Donate )
Nice script, but it seems a little buggy at times.
03-18-2007, 11:46 AM
· #12 NamePros Regular
Location: NYC
Join Date: May 2004
Posts: 234
NP$: 75.00 (
Donate )
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).
Other than that, looks nice so far.
03-18-2007, 12:48 PM
· #13 DNOA Member
Join Date: May 2006
Posts: 256
NP$: 68.15 (
Donate )
I'll try to fix them up asap.
3l3ctr1c
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off