<?
// Query whether a domain name exists
Function searchdomain ($ domainname ){
// Determine whether the domain name is legal. I am not familiar with the regular expression. I 'd like to take a look at the details of this friend.
// If (! Eregi ("*. *", $ domainname )){
// $ Re [0] = "the domain name can only contain letters, numbers, and"-"(minus signs on the keyboard). The maximum length is 26 characters. <Br> enter the domain name in the correct format! ";
// $ Re [1] = "the domain name does not meet the requirements! ";
// Return $ re;
//}
$ Name = strtolower ($ domainname); // small write
If (strpos ($ name, ". cn") // if it contains a domestic domain name
$ Command = "whois-H whois.cnnic.net.cn ";
Else
$ Command = "whois ";
$ Query = escapeshellcmd ($ command. $ name); // prevents others from playing tricks
Exec ($ query, $ whoisresult [], $ whoisreturnvalue );
For ($ I = 0; $ I <count ($ whoisresult [0]); $ I ++)
$ Result. = $ whoisresult [0] [$ I]. "<br> ";
$ Re [0] = $ I <30? "This domain name has not been registered. Please register now! ":" This domain name has been registered by other organizations! ";
$ Re [1] = $ result;
Return $ re;
}
$ Domainname = "www.newhua.com.cn ";
$ Result = searchdomain ($ domainname );
Print "Domain Name application: <br> ";
Print $ result [0];
Print "<br> query result <br> ";
Print $ result [1];
?>