whois script help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
skullnls
Forum Newbie
Posts: 1
Joined: Tue Aug 19, 2003 3:52 pm

whois script help

Post by skullnls »

im reconfiguring a php whois script to display the whois info of about 300,00 domains and i need some help.
Here is the code that will basiclly make the script work. were flohost.com is were i need it to call a .txt and display the results from all the domains in the .txt
<?
include("Whois.php");
$whois = new Whois();
echo $whois->lookup("flohost.com");<-----were .txt syntax cmd would be
echo "<HR>";
?>

can anyone help me with this...??
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

This might help:
user notes PHP manual function fsockopen() wrote:This example queries Network Solutions whois database:

Code: Select all

$domain = "arifbudiman.net";
if (trim($domain) <> "") {
  $domain = trim($domain);
  $fp = fsockopen("whois.networksolutions.com", 43, $errno, $errstr, 30);
  if (!$fp) {
     echo "$errstr ($errno)";
  } else {
     fputs($fp, "$domain\r\n");
     print "<pre>\r\n";
     while (!feof($fp)) {
        echo fread($fp,128);
     }
     print "</pre>";
     fclose ($fp);
  }
}
akistp
Forum Newbie
Posts: 1
Joined: Fri Mar 12, 2004 8:44 am
Location: Greece

Regarding the fsockopen()

Post by akistp »

I'm trying to make this work for .gr name registration....
Unfortunately the hostamaster here does not provide a whois server (for some reason unknown!!)
Still there is a webwhois interface at the url below
https://grweb.ics.forth.gr/english/webwhois_for_gr.htm

that submits to

https://grweb.ics.forth.gr/servlet/gr.h ... PTIONS=All


So what i want is to fsockopen the url response and to try to parse it and check to what is the response.... If the response is that the domain "Exists..." then, display a domain unavailable message and if the response is that the domain "not Exists..." then a domain available message....

Can the above function be modified?? I guest the fisrt thing to get rid off is the port 43...change that to 80....What else??? Can anyone help me on this!!

Thank you all in advance!
Post Reply