比较简单的判断方式,直接查询域名是否存在dns……

if(IS_POST){
    $sld=I('sld');
    $tld=I('tld');
    $domain=$sld.$tld;
    $response = @dns_get_record($domain, DNS_ALL);

    if(empty($response)){
        echo "<H2 style='color:green;' >Domain $name_domain is available.</H2>";
    }else{
        echo "<H2 style='color:red;'>Domain $name_domain has taken.</H2>";
    }
}

标签: PHP

添加新评论