Curl, ccTLD .id
Wednesday, February 21st, 2007Last Night, My script didn't work well while contacting register.net.id's whois port.
PORT STATE SERVICE
43/tcp closed whois
Yeah, it's closed. So, i write a code to check domain availability through the-must-opened port ( http!!) Using PHP + libcurl.
-
<?
-
$available = "Domain Belum Terdaftar";
-
$navigation = 'domain'; //form jack!
-
$keyword = 'amikom'; //nama domain
-
$domain_category = 'ac.id'; // ccTLD
-
$ch = curl_init();
-
curl_setopt($ch, CURLOPT_URL, 'http://register.net.id/whois');
-
curl_setopt($ch, CURLOPT_HEADER, 1);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-
curl_setopt($ch, CURLOPT_POST, 1);
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
-
$data = curl_exec($ch);
-
if($cek == true){
-
echo "Domain masih available";
-
} else {
-
echo "Domain tidak available";
-
}
-
curl_close($ch);
-
?>