| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,830
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP whois hi please tell me what php code do i have to write for getting the whois information of a particular domain from the registry? i am looking for only .com and .net registries right now thanks |
| |
| | #2 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | The following works for getting whois information:- PHP Code: |
| |
| | THREAD STARTER #5 (permalink) |
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,830
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | i used the code and it worked perfectly can u please explain some things to me that i fail to grasp: 1. why are we using Code: $info .= fgets($sock,128); what is the use of Concatenate here? 2. what is 128 in the fget()? thanks |
| |
| | #6 (permalink) |
| Senior Member Join Date: Jan 2007 Location: Wales - United Kingdom
Posts: 1,774
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 1) The concatenate is used to add the string (fgets($sock,128) to the $info variable (i.e. because then, after the loop's complete, "echo $info" can be used in one go to echo everything). But yes, "$info=fgets($sock,128) . $info" should also do the same thing.2) The 128 is the maximum length of what's returned by the results |
| |
| | #7 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Yes as tristanperry stated the 128 is the amount of bytes to read at a time. The reason we specify it as the PHP manual specifies that it is more resource efficient to do so (http://php.net/fgets) Regarding the $info .= fgets($sock,128); line it achieves exactly the same as what you wrote but is just another way of doing it. |
| |
| | #9 (permalink) | ||||
| If only you knew... Join Date: Oct 2005 Location: Inside your head...
Posts: 998
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| ||||
| |
| | #11 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Some spammers use whois results to harvest email accounts as stated by maximum. Another method than using usleep etc is by using more than 1 whois server and alternate between which ones you use. |
| |
| | THREAD STARTER #15 (permalink) | ||||
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,830
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| ||||
| |
| | #16 (permalink) | ||||||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]()
????: NamePros.com http://www.namepros.com/showthread.php?t=331121 What sort of response are you getting from them when you get an error? | ||||||||
| |
| | THREAD STARTER #17 (permalink) | ||||
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,830
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | here is the error
| ||||
| |
| | #20 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: Tucson, AZ
Posts: 689
![]() | What I'd like to know is how you get around the issue of some registrar's not listing complete info in their whois registries and forcing you to use a web interface with a captcha to get the information. |
| |
| | #21 (permalink) | ||||||||
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The only possible solutions are as follows:- 1) Find out how many queries you can make in x amount of time and use sleep or usleep to ensure you do not do too many queries. 2) Use more than 1 whois server to find the results. 3) Use a bank of proxies that will help. The best solution is a combination of options 1 and 2. Option 3 should be avoided as it could end up you being permanently banned from using the whois server in question. | ||||||||
| |
| | #22 (permalink) |
| NamePros Regular Join Date: Oct 2006
Posts: 351
![]() ![]() ![]() ![]() | Thanks for this tool! Can anybody just tell how to get the available or not status? I mean if the domain is available show XXXX and if not show "YYYY" Thanks!
__________________ Recetas de Cocina (In Spanish) | Perros Pastor Aleman (In Spanish) | Where is my sign??? |
| |
| | THREAD STARTER #23 (permalink) | ||||
| Senior Member Join Date: Oct 2006 Location: http://akshayjain.org
Posts: 2,830
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=331121 2. different whois servers is definately a help. i will rotate between those three servers that u mentioned 3. proxies: i think that requires a. more advanced coding which i am not familiar with b. good proxies are hard to find therefore the script will hardly function when any proxy goes down | ||||
| |