<?
// Query whether a domain name exists
Function SearchDomain ($ domainName ){
// Determine whether the domain name is legal. I am not familiar with the regular expression. If that friend has more details, please refer to the following link :-)
// 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];
?>