Programs that check whether a domain name is registered

Source: Internet
Author: User
Tags domain server
? PHPif ($ domain) {if ($ domain) {firstgetthedomainserverfrominternic $ fpfsockopen (rs.internic.net, 43, $ errno, $ errstr, 10); if (! $ Fp) {echo $ errstr ($ errno) n;} else {fputs ($ fp, $ domainrn); while (! Feof ($ fp) {$ buffgets ($ fp
If ($ domain)

{

If ($ domain)

{

// First get the domain server from internic



$ Fp = fsockopen ("rs.internic.net", 43, & $ errno, & $ errstr, 10 );

If (! $ Fp)

{

Echo "$ errstr ($ errno)

N ";

}

Else

{

Fputs ($ fp, "$ domainrn ");

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" Unfortunately, $ domain is registered on $ server:



Below is the detailed registration information:
";

Echo"

";

$ Fp = fsockopen ($ server, 43, & $ errno, & $ errstr, 10 );

If (! $ Fp)

{

Echo "cocould not open connection to $ server on port 43.n ";

Echo "$ errstr ($ errno)

N ";

}

Else

{

Fputs ($ fp, "$ domainrn ");

While (! Feof ($ fp ))

{

Echo fgets ($ fp, 128 );

}

Fclose ($ fp );

}

}

Else {

Echo ("Congratulations! $ Domain at $ now (time)

The domain name has not been registered yet. the international domain name is decreasing every 5 seconds. please register at the Qilu hotline.

");

}

Echo ("

");

}



}

?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.