5, September 2008

Adding more tlds to the server array list - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  PHP Whois script (Moderator: Olaf)
Topic: Adding more tlds to the server array list
« previous next »
Pages: [1] Print

Author Topic: Adding more tlds to the server array list  (Read 3938 times)
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« on: Sep 29, 2006, 04:18:38 PM »

At first i want to thank you for publishing and sharing your php whois class. I can tell you that i use it with much pleasure. I have a question, in the file where I can ad more servers to the array for the multiple domain check I want to ad domains like .tv .co.nz etc… but how do I know witch answer the whois server gives me so I can check if it is free or not, and where can I find more whois servers?

Many thanks

(p.s sorry, i'am from the netherlands and my english isn't verry good Smiley)
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Sep 29, 2006, 04:46:09 PM »

welcome @ webdigity laurens!

your english is very good (here are so much non native english speakers Wink)

I wrote this small snippet to test unknown whois servers:

Code:
<?php
function get_whois_data($test_server$test_domain) {
$msg "";
$connection fsockopen($test_server43$errno$errstr10);
if (!$connection) {
$msg "Can't connect to the server!";
} else {
sleep(2);
fputs($connection$test_domain."\r\n"); 
while (!feof($connection)) {
$msg[] = fgets($connection4096);
}
fclose($connection);
}
return $msg;
}
print_r(get_whois_data("whois.nic.us""finalwebsites.us"));

this way you get all the information for this domain, next you need to search for the string that gives the information that a domain name is "free" or not...


Last blog : Is your website is down? Know before your visitors do!
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Sep 29, 2006, 04:54:08 PM »



(p.s sorry, i'am from the netherlands and my english isn't verry good Smiley)

Laurens, maybe this thread Visit through proxy is interesting for you:


(at the moment there is a good chance to get a ticket for free)


Last blog : Is your website is down? Know before your visitors do!
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #3 on: Sep 29, 2006, 05:24:16 PM »

Thanks for replaying. I have found a very usefull xml document for us all i think, check this:
http://serverlist.domaininformation.de/ Visit through proxy
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Sep 29, 2006, 05:43:09 PM »

Thanks for replaying. I have found a very usefull xml document for us all i think, check this:
http://serverlist.domaininformation.de/ Visit through proxy

looks good, I think thats a good base for an Ajax powered whois form or complete whois applications (if you put all the tld's into a list, thhe becomes very long)

thank you for sharing this...


Last blog : Is your website is down? Know before your visitors do!
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #5 on: Sep 29, 2006, 05:46:26 PM »

Thanks for replaying. I have found a very usefull xml document for us all i think, check this:
http://serverlist.domaininformation.de/ Visit through proxy

looks good, I think thats a good base for an Ajax powered whois form or complete whois applications (if you put all the tld's into a list, thhe becomes very long)

thank you for sharing this...

Yes indead, and this information is also very usefull for the server_list.php:
<availstring>no matching record</availstring>
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Sep 29, 2006, 05:56:11 PM »



Yes indead, and this information is also very usefull for the server_list.php:
<availstring>no matching record</availstring>

... I thought about to use the XML file in place of the server list...


Last blog : Is your website is down? Know before your visitors do!
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #7 on: Sep 30, 2006, 04:33:33 PM »



Yes indead, and this information is also very usefull for the server_list.php:
<availstring>no matching record</availstring>

... I thought about to use the XML file in place of the server list...
Could be very handy, than you can read it with PHP or any other application that has xml support Smiley
By the way, i noticed you use sleep(2); in the whois class, my multiple whois app was vert slow, after i had deleted sleep(2); it was much quicker. Why do you use sleep(2);?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Sep 30, 2006, 04:59:36 PM »

Why do you use sleep(2);?

can't find the sleep(2) code where did you find it!


Last blog : Is your website is down? Know before your visitors do!
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #9 on: Oct 01, 2006, 11:42:26 PM »

I found it in the get_whois_data method:

Code:
function get_whois_data($empty_param = false) {
// the parameter is new since version 1.20 and is used for .nl (dutch) domains only
if ($empty_param) {
$this->whois_param = "";
}
if ($this->tld == "de") $this->os_system = "win"; // this tld must be queried with fsock otherwise it will not work
if ($this->os_system == "win") {
$connection = @fsockopen($this->whois_server, 43);
if (!$connection) {
unset($connection);
$this->msg = "Kan geen verbinding maken met de server!";
return;
} else {
sleep(2); // <--- HERE IS THE SLEEP 2!
fputs($connection, $this->whois_param.$this->compl_domain."\r\n");
while (!feof($connection)) {
$buffer[] = fgets($connection, 4096);
}
fclose($connection);
}
} else {
$string = "whois -h ".$this->whois_server." \"".$this->whois_param.$this->compl_domain."\"";
$string = str_replace (";", "", $string).";";
exec($string, $buffer);
}
if (isset($buffer)) {
//print_r($buffer);
return $buffer;
} else {
$this->msg = "Can't retrieve data from the server!";
}
}
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #10 on: Oct 01, 2006, 11:45:28 PM »

By the way, i'am using a bit of Ajax for the multiple Whois check. If you like it, check the source and just copie if you like Smiley
http://www.bvhsolutions.eu/Test/whois/ Visit through proxy

//tomorow i have a Masterclass session so i will do the greetings to Wouter Wink

« Last Edit: Oct 01, 2006, 11:59:36 PM by Laurens »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #11 on: Oct 02, 2006, 12:01:01 AM »

yes you're right I didn't found the sleep... Wink
I'm not sure why I added the sleep there, If you don't have problems just remove it.



Last blog : Is your website is down? Know before your visitors do!
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #12 on: Oct 02, 2006, 12:04:29 AM »

yes you're right I didn't found the sleep... Wink
I'm not sure why I added the sleep there, If you don't have problems just remove it.
Yep, no problems at all and the speed hase increased al lot Smiley
What name can i tell to Wouter? And did you do the same study?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #13 on: Oct 02, 2006, 12:13:09 AM »


Yep, no problems at all and the speed hase increased al lot Smiley
What name can i tell to Wouter? And did you do the same study?
I hope he will remember my first name "Olaf"
no I don't was student Wink


Last blog : Is your website is down? Know before your visitors do!
My name is Bong, James Bong
*
Posts: 12
76 credits
Members referred : 0


« Reply #14 on: Oct 02, 2006, 12:15:59 AM »


Yep, no problems at all and the speed hase increased al lot Smiley
What name can i tell to Wouter? And did you do the same study?
I hope he will remember my first name "Olaf"
no I don't was student Wink
Do you know him from the conferences? He has written a great php book! Smiley
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #15 on: Oct 02, 2006, 12:19:31 AM »


Do you know him from the conferences? He has written a great php book! Smiley
almost a year before we discussed about some work in one of his bigger projects and of course I was at the php conference last year...


Last blog : Is your website is down? Know before your visitors do!
Total Zero
*
Posts: 5
34 credits
Members referred : 0


« Reply #16 on: Oct 04, 2006, 01:29:21 AM »

By the way, i'am using a bit of Ajax for the multiple Whois check. If you like it, check the source and just copie if you like Smiley
http://www.bvhsolutions.eu/Test/whois/ Visit through proxy

//tomorow i have a Masterclass session so i will do the greetings to Wouter Wink



Laurens, look at your website: Webhosting>Prenium... Shouldn't that be: "Premium" ? Good luck with your website!
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 credits
Members referred : 374


It's time to use PHP5!


« Reply #17 on: Oct 04, 2006, 08:56:19 AM »



Laurens, look at your website: Webhosting>Prenium... Shouldn't that be: "Premium" ? Good luck with your website!
this is really a dutch thing "prenium" the same for "developement" Grin


Last blog : Is your website is down? Know before your visitors do!
Just another rainy day
*
Posts: 1
6 credits
Members referred : 0


« Reply #18 on: Sep 25, 2007, 01:57:57 PM »

Hi, I need to add a search for more tld's

co.za with the whois server being whois.co.za

then

za.org
za.net with the whois server being whois.za.net

Thanks in advance Smiley
« Last Edit: Sep 25, 2007, 02:36:29 PM by Seagyn Davis »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4286
Tags : php domains webdigity whois snippets Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  PHP Whois script (Moderator: Olaf)
Topic: Adding more tlds to the server array list
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 05, 2008, 02:08:42 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.293
Total Topics: 7.476
Total Members: 3.897
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: FlorianHofmann

26 Guests, 4 Users online :

15 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.