Query if a domain name exists
function Searchdomain ($domainName) {
To determine whether the domain name is legitimate, I am not familiar with the formal expression, the friend has detailed information, may wish to borrow me a read:-)
if (!eregi ("*.*", $domainName)) {
$re [0]=] domain names can only be letters, numbers, and "-" (a minus sign on the keyboard), with a maximum length of 26 characters. <br> please fill in the correct format domain name! ";
$re [1]=] domain name does not meet the requirements! ";
return $re;
// }
$name =strtolower ($domainName); Turn lowercase
if (Strpos ($name, ". CN"))//If a domestic domain name is included
$command = "Whois-h whois.cnnic.net.cn";
Else
$command = "Whois";
$query =escapeshellcmd ($command. $name); To prevent anyone from doing anything.
EXEC ($query, $whoisResult [], $whoisReturnValue);
$re [0]= $i <30?] This domain name has not yet been registered, please register immediately! ":" This domain name has been registered by other organizations! ";
$re [1]= $result;
return $re;
}
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.