The following is a simple WHOIS program, which is unknown to the original, which is not comprehensive enough, I hope there is a function of throwing bricks:
// This example implements top-level domain names with PHP4
IF ($ DOMAIN)
{
IF ($ DOMAIN)
{
/ / Connect to the INTERNIC Domain Name Server
$ fp = fsockopen ("rs.internic.net", 43, & $ errno, & $ errstr, 100);
IF (! $ fp)
{
Echo "$ Errstr ($ Errno)
/ N";
}
Else
{
FPUTS ($ FP, "$ DOMAIN / R / N");
While (! Feof ($ fp))
{
$ buf = fgets ($ fp, 128);
IF (EREG ("Whois Server:", $ BUF))
{
$ Server = STR_REPLACE ("Whois Server:", "", $ BUF);
$ Server = Trim ($ server);
}
}
Fclose ($ fp);
}
IF ($ server)
{
Echo " $ domain's registration server is $ server: b>
Echo "
";$ fp = fsockopen ($ Server, 43, & $ Errno, & $ Errstr, 10);
IF (! $ fp)
{
Echo "cannot be connected to the 43 port of the server $ server ./N";
Echo "$ Errstr ($ Errno)
/ N";}
Else
{
FPUTS ($ FP, "$ DOMAIN / R / N");
While (! Feof ($ fp))
{
Echo fgets ($ FP, 128);
}
Fclose ($ fp);
}
}
Else {
Echo (" $ domain is not registered. b>
");}
ECHO (" pre>
);}
}
?>