Topic: Adding more tlds to the server array list (Read 3810 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 )
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 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 )
I wrote this small snippet to test unknown whois servers:
Code:
<?php function get_whois_data($test_server, $test_domain) { $msg = ""; $connection = fsockopen($test_server, 43, $errno, $errstr, 10); if (!$connection) { $msg = "Can't connect to the server!"; } else { sleep(2); fputs($connection, $test_domain."\r\n"); while (!feof($connection)) { $msg[] = fgets($connection, 4096); } 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...
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)
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:
Posts: 6280
38506 credits Members referred : 374
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 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:
Posts: 6280
38506 credits Members referred : 374
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 http://www.bvhsolutions.eu/Test/whois/
//tomorow i have a Masterclass session so i will do the greetings to Wouter
« Last Edit: Oct 01, 2006, 11:59:36 PM by Laurens »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 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... I'm not sure why I added the sleep there, If you don't have problems just remove it.
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 http://www.bvhsolutions.eu/Test/whois/
//tomorow i have a Masterclass session so i will do the greetings to Wouter
Laurens, look at your website: Webhosting>Prenium... Shouldn't that be: "Premium" ? Good luck with your website!
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6280
38506 credits Members referred : 374